Sawala CloudSawala Cloud — Docs
AkunaReference

Akuna API & embed reference

Akuna's public config endpoint and the @sawala/akuna-react package — props, hooks, and exports.

TODO: translate to Indonesian. English source is authoritative; render it into Indonesian below.

Most integrations use the @sawala/akuna-react embed, which calls the config endpoint for you. Both surfaces are documented here.

Base URL

https://api.sawala.cloud/public/akuna

GET /config

Returns the boot configuration for the active connection in the API key's scope. Authenticate with a publishable API key scoped for Akuna (X-API-Key).

FieldTypeNotes
clerkPublishableKeystringYour Clerk app's publishable key, for booting Clerk
clerkInstanceDomainstringThe Clerk instance domain
appearanceobject | nullOptional appearance config
signUpEnabledbooleanWhether sign-up is offered
organizationsEnabledbooleanWhether Clerk organizations are enabled

No secret fields are ever returned. If no active connection exists for the scope, the endpoint responds 404 NO_ACTIVE_CONNECTION.

@sawala/akuna-react

npm install @sawala/akuna-react @clerk/clerk-react react react-dom

<MembershipProvider>

Fetches /config with your API key and boots Clerk. Props:

PropRequiredNotes
apiKeyyesSawala project-scoped publishable key (pk_live_… / pk_test_…) for the Akuna product
baseUrlnoOverride the gateway base. Defaults to https://api.sawala.cloud/public/akuna
loadingFallbacknoRendered while the config loads
errorFallbackno(error) => ReactNode, rendered if the config fetch fails

Hooks

  • useMember() — the signed-in member: { member, isLoaded }.
  • useMembershipConfig() — the resolved connection config.

Re-exported Clerk components

SignIn, SignUp, UserButton, SignedIn, SignedOut, RedirectToSignIn — use them as you would from @clerk/clerk-react, but booted through <MembershipProvider>.

The embed needs an active connection for the key's scope. Without one, /config returns 404 NO_ACTIVE_CONNECTION and the provider renders its errorFallback.

For a working setup, see Add membership to a React app.

Daftar Isi