Block-Auth SDKs
Block-Auth has SDKs for both sides of your app: a login widget for your frontend and a client for your backend. Together they add passwordless login without your app ever trusting the browser.
Which SDK you need
| Where | Package | What you use in your code |
|---|---|---|
| React | @block-auth.io/react | BlockAuthProvider, <FlowBlockAuth />, <LinkBlockAuth />, useBlockAuthUser() |
| Vue | @block-auth.io/vue | createBlockAuth(), <FlowBlockAuth />, <LinkBlockAuth />, useBlockAuthUser() |
| Angular | @block-auth.io/angular | provideBlockAuth(), <ba-flow-block-auth>, <ba-link-block-auth>, BlockAuthService |
| Node.js | @block-auth.io/node | BlockAuthRoutes, blockauthRouter(), AuthCodeClient |
| PHP | blockauth/sdk | BlockAuthRoutes, AuthCodeClient |
| Python | blockauth-sdk | BlockAuthRoutes, blockauth_blueprint() (Flask), blockauth_router() (FastAPI), AuthCodeClient |
| .NET | BlockAuth.Sdk.AspNetCore | AddBlockAuth(), MapBlockAuth(), AuthCodeClient |
| WordPress | Block-Auth Login plugin | Login button, account linking, users and roles |
The three frontend packages share the same engine, @block-auth.io/core, and offer the same components. The backend packages give you BlockAuthRoutes, the routes the widget calls, ready to mount in your server, and AuthCodeClient for the redirect login. In .NET, BlockAuth.Sdk.AspNetCore brings BlockAuth.Sdk with it.
AuthCodeClient has the same methods in every language: authorize, exchangeCode, signOut, revokeLink and verifyWebhook (in Python, exchange_code, sign_out…; in .NET, ExchangeCodeAsync, SignOutAsync…).
Two ways to integrate
Both end the same way: your backend redeems a one-time code with your apiSecret and creates its own session.
- Widget and your backend. The Block-Auth button lives in your frontend and opens the login in a popup; your backend redeems the code. Best for single-page apps in React, Vue or Angular. Follow the SDK Quickstart.
- Redirect login. Your frontend only has a link; your backend redirects the user to Block-Auth and receives them back. Best for server-rendered apps. See PHP, Python, .NET, Node.js.
The rule that matters
- The
apiKeyis public: it goes in your frontend. - The
apiSecretis private: it stays in your backend, never in the browser. - Your backend only trusts the user it gets from
POST /api/auth/token, never an address sent by the browser.
What's next?
- SDK Quickstart: pick the guide for your stack and integrate from zero, step by step.
- Customize the widget: every prop of the React, Vue and Angular components.
- Roles: show or hide parts of your UI by role.

