@gobing-ai/turnstile-client
v0.3.0
Published
Public Turnstile SDK for customer authentication, subscription, checkout, and tracking flows.
Readme
@turnstile/client
Public Turnstile integration SDK for application developers.
Audience
- application teams integrating with Turnstile
- app frontends or app backends using customer-facing Turnstile APIs
Owns
- customer checkout session creation
- customer billing portal access
- application config fetch
- OIDC helpers
- auth sync helpers
- subscription access helpers
- tracking helpers
Does Not Own
- admin user management
- settings CRUD
- queue, pipeline, and job operations
- manual Stripe/Zitadel sync
- reconciliation and internal reporting
Usage
import { createTurnstileClient } from '@turnstile/client';
const client = createTurnstileClient({
baseUrl: 'https://turnstile-api.example.com',
token: 'customer-access-token',
applicationId: 'surfing',
});
await client.checkout.createSession({
tier: 'standard',
billingCycle: 'monthly',
});
const appConfig = await client.config.getApplicationConfig();Final Public Surface
createTurnstileClient(...)TurnstileClientclient.checkout.createSession(...)client.billing.createPortalSession(...)client.config.getApplicationConfig(...)- OIDC/auth sync helpers
- subscription access helpers
- tracking helpers
Not exported:
TurnstileCustomerClient- admin APIs
- transport primitives like
BaseApiClientorTurnstileError - deprecated
checkout.create(...)
Boundary
@turnstile/client no longer exposes admin APIs or shared transport primitives.
Use:
@turnstile/admin-clientfor console and internal admin tooling@turnstile/api-client-corefor low-level transport helpers
