Is your feature request related to a problem? Please describe.
Every permission check requires a network call to the Permify service, which adds latency and extra infrastructure overhead. It also makes it difficult to keep application writes and permission writes in sync. If one succeeds and the other fails, there is no simple way to roll both back together
Describe the solution you'd like
Add support for running Permify as an embedded Go library instead of only as a standalone service. This should expose the same core behavior and schema model, but allow applications to call Permify in-process.
For applications using Postgres with the pgx, it should also be possible to pass an existing pgx.Tx into Permify write operations so application writes and permission writes can share the same database transaction and commit or roll back together.
Describe alternatives you've considered
Continuing to use Permify as a separate service over gRPC/HTTP. This works, but keeps the extra network hop and does not solve same-transaction writes. Another alternative is compensating logic or cleanup on failure, but that is more complex and less reliable than a shared transaction.
Additional context
This has been requested by a customer.
Is your feature request related to a problem? Please describe.
Every permission check requires a network call to the Permify service, which adds latency and extra infrastructure overhead. It also makes it difficult to keep application writes and permission writes in sync. If one succeeds and the other fails, there is no simple way to roll both back together
Describe the solution you'd like
Add support for running Permify as an embedded Go library instead of only as a standalone service. This should expose the same core behavior and schema model, but allow applications to call Permify in-process.
For applications using Postgres with the pgx, it should also be possible to pass an existing pgx.Tx into Permify write operations so application writes and permission writes can share the same database transaction and commit or roll back together.
Describe alternatives you've considered
Continuing to use Permify as a separate service over gRPC/HTTP. This works, but keeps the extra network hop and does not solve same-transaction writes. Another alternative is compensating logic or cleanup on failure, but that is more complex and less reliable than a shared transaction.
Additional context
This has been requested by a customer.