Writing a provider
None of the shipped providers fit? Write an adapter for an in-house identity service, a different database, or an S3-compatible store.
Steps
- Implement the interface(s) you need from
@selvajs/platform:IAuthProvider,IDataProvider,IStorageProvider. Adopt just one role and reuse shipped providers for the rest. - Scope everything by
RequestContext. The query is the security boundary: an unauthorized caller gets empty results or an error, never someone else’s data. - Run the conformance suites from
@selvajs/platform/testing(runAuthProviderConformance,runDefinitionStoreConformance,runOrgStoreConformance, and the rest) against your adapter. Passing means it behaves identically to the reference implementation. - Wire it in with
defineConfig({ auth, data, storage })in a.jsfile, and pointSELVA_CONFIG_PATHat it.
The contract
The platform README is authoritative, including the transaction-ordering rules that keep the metadata store and blob store recoverable when one fails mid-operation: they share no transaction.