---
title: "Integration checklist"
description: "What to go over before calling your Block-Auth integration done: the security rules, the placeholders to replace and how to check that it works."
url: "/sdk-integration-checklist/"
language: "en"
---

# Integration checklist

Go over it before calling your integration done, whichever guide you follow: the security rules it must keep, the example values to replace and how to check that it works.

## Security rules

Your integration must keep all these rules. Each one is explained in the guides and in [Security](/security.md).

- **The API Secret only lives in the backend.** Read it from an environment variable or your secret store. Never put it in frontend code, in a `VITE_`, `NEXT_PUBLIC_` or `REACT_APP_` variable, in Angular's `environment.ts`, in a committed file or in a log. The API Key is public and goes in the frontend.
- **The browser never decides who the user is.** The widget only hands a one-time code to the backend. The backend redeems it at `POST /api/auth/token` with the API Secret (the Block-Auth packages do it for you) and only then creates its own session. Never trust a user or address sent by the browser.
- **With the Node.js package, the order matters.** Mount `blockauthRouter(routes)` after `session(...)` and before `express.json()`, and make the session cover `/auth/blockauth`, not only `/api`.
- **The widget calls `/auth/blockauth` on the same origin as the page.** In development, use your dev server's proxy. In production, serve the frontend from the backend or send `/auth/blockauth` to it with a reverse proxy, over `https`. Don't open CORS for it.
- **With the redirect login, check `state`** before redeeming the code.
- **Verify every webhook** before trusting it: the Block-Auth packages do it, and the [Webhooks](/webhooks.md) page explains how to do it yourself.
- **Use role slugs, not names.** Role names can change; slugs never do.
- **Don't let the session outlive `signedExpiredAt`**, the moment the user's signature for the app expires ([how long a session lasts](/security.md#session)).
- **Frontend only (`authEndpoint: false`) only shows who is signed in.** There's no backend redeeming the code, so the rules about the backend and `/auth/blockauth` don't apply to it, but no server has a session it can trust either. Never use the address the page knows to authorize anything on a server: if the app has an API or private data, follow [React, Vue or Angular (+ backend)](/sdk-integration-spa.md).

## Placeholders

The code in the docs uses these placeholders. Replace every one before finishing, and never with a made-up value:

| Placeholder                                                                                                                                                      | What to do                                                                                                                     |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `sha256_hex_of_your_api_secret`, `sha256_of_api_secret`                                                                                                          | Replace the `sha256_…` value with the SHA-256 hash (hex) of your API Secret. Compute it on your computer, never on a web page. |
| `your_api_secret`, `<pega el API Secret del Dashboard>`, `<paste the API Secret from the Dashboard>`                                                             | Replace the API Secret placeholder with your API Secret, copied straight from the Dashboard. Never paste it on this site.      |
| `a_long_random_string`, `<genera uno: openssl rand -hex 32>`, `<generate one: openssl rand -hex 32>`                                                             | Replace the SESSION\_SECRET placeholder with a random value generated on your computer: `openssl rand -hex 32`.                |
| `your_api_key`                                                                                                                                                   | Replace `your_api_key` with your API Key, or fill in your data in the SDK Quickstart and it is filled in for you.              |
| `https://your-app.com`                                                                                                                                           | Replace `https://your-app.com` with your app URL, or fill in your data in the SDK Quickstart and it is filled in for you.      |
| `your-app.com`                                                                                                                                                   | Replace `your-app.com` with your domain, or fill in your data in the SDK Quickstart and it is filled in for you.               |
| `https://example.com`                                                                                                                                            | Replace `https://example.com` with your app’s validated domain.                                                                |
| `https://your-site.com`                                                                                                                                          | Replace `https://your-site.com` with your WordPress site URL.                                                                  |
| `acme-x7k2p9`                                                                                                                                                    | Replace `acme-x7k2p9` with the slug of one of your roles: copy it from the Roles tab in the Dashboard, under the role name.    |
| `"your-app": {`                                                                                                                                                  | Replace `your-app` with your project name: the key you already have under `projects` in your `angular.json`.                   |
| `your_access_token`                                                                                                                                              | Replace `your_access_token` with the access token you get from `/api/signin`. It lasts 1 hour.                                 |
| `your_refresh_token`                                                                                                                                             | Replace `your_refresh_token` with the refresh token you got from `/api/signin`.                                                |
| `code_from_the_widget`, `code_verifier_from_the_widget`, `redirect_uri_from_the_widget`                                                                          | Replace the `…_from_the_widget` values with the ones the widget sends to your `/code` route.                                   |
| `code_from_your_callback`                                                                                                                                        | Replace `code_from_your_callback` with the `code` Block-Auth sends to your callback URL.                                       |
| `"your-app"`                                                                                                                                                     | Replace `your-app` with your project name in `angular.json`.                                                                   |
| `findUser`, `saveSignout`, `lastSignout`, `removeLink`, `endSessionsOf`, `markUnlinked`, `alreadyProcessed`, `isLinked`, `saveLink`, `listOrders`, `deleteOrder` | `findUser`, `saveSignout`… are yours: replace them with your app’s own functions (your database, your cache…).                 |

## Definition of done

The integration is done when the last Quickstart step, Go live, passes on your domain. Before that, the same check must pass in development:

- **React, Vue or Angular:** after signing in with the Block-Auth button, `GET /auth/blockauth/me` in the same browser returns the user. A `404` or your app's page means the request doesn't reach the backend; a `401` means the login didn't create the session. See [Connect and try it](/sdk-integration-spa-connect.md#try-it).
- **React, Vue or Angular, frontend only:** after signing in with the Block-Auth button, it turns into the profile menu, and the user is still signed in after reloading the page. See [Try it](/sdk-integration-frontend-try.md).
- **PHP, Python, .NET, Node.js:** opening `/blockauth/login` and signing in brings the user back signed in, and `GET /api/me` returns them. See [Login](/sdk-integration-server-login.md#try-it).
- **WordPress:** after signing out, the Block-Auth button on `/wp-login.php` signs the user in to WordPress. See [Connect it](/sdk-integration-wordpress-connect.md#try-it).

Also check that the API Secret doesn't appear anywhere in the frontend build output or in the repository, and that the app's own lint and tests still pass.

## For AI assistants

If an AI assistant (Claude Code, Cursor, Copilot, ChatGPT…) does the integration, give it the docs in Markdown. The website shows one framework, backend or environment at a time; the Markdown has every variant at once:

- [`/llms.txt`](/llms.txt): the index of every page, with the guides in order.
- [`/llms-full.txt`](/llms-full.txt): every page in a single file.
- `/llms/<stack>.md`: one guide per stack (for example [`/llms/react-vite-node.md`](/llms/react-vite-node.md)), with only its steps, in order. The list is in `/llms.txt`.
- Any page with `.md` added to its path, for example [`/sdk-integration-spa-backend.md`](/sdk-integration-spa-backend.md). Each page also points to it with `<link rel="alternate" type="text/markdown">`.

In the Markdown versions every tab and option is written out and marked (for example, _Only for Node.js_ or _In production_), and the code keeps its placeholders. Follow only the variant that matches the app.

### Pick your guide

Look at the app first, then follow one guide only, from its first page to the end of its Quickstart:

| If the app…                                                                                                         | Follow                                                                |
| ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| Has a React, Vue or Angular frontend (Vite, Next.js, Create React App or Angular CLI) and a backend in any language | [React, Vue or Angular (+ backend)](/sdk-integration-spa.md)          |
| Has a React, Vue or Angular frontend and no backend, and only needs to show who is signed in                        | [React, Vue or Angular (frontend only)](/sdk-integration-frontend.md) |
| Renders its pages on the server, in PHP, Python, .NET or Node.js, without a React, Vue or Angular frontend          | [PHP, Python, .NET, Node.js](/sdk-integration-server.md)              |
| Is a WordPress site                                                                                                 | [WordPress](/sdk-integration-wordpress.md)                            |

Every guide except frontend only needs a backend that redeems the login code (in WordPress, the plugin is that backend). Before the first step, the app must exist in the [Dashboard](/integration-quickstart.md#applications) with its keys: if an AI assistant does the integration, give it the API Key yourself and set the API Secret yourself.

### Required steps

Each guide starts with a page to read first and then the Quickstart steps, in this order. All of them are required. The pages under **More options** (webhooks, linking users, customizing the widget) are optional: add them when the app needs them.

**React, Vue, Angular (+ backend)**

1. [Before you start](/sdk-integration-spa.md)
2. [Your frontend](/sdk-integration-spa-frontend.md): Install the widget and add the login button.
3. [Your backend](/sdk-integration-spa-backend.md): Add the routes that redeem the login code.
4. [Connect and try it](/sdk-integration-spa-connect.md): Connect your frontend to your backend and check the login.
5. [Go live](/sdk-integration-spa-go-live.md)

**React, Vue, Angular (frontend only)**

1. [Before you start](/sdk-integration-frontend.md)
2. [Your frontend](/sdk-integration-frontend-setup.md): Install the widget and add the login button.
3. [Try it](/sdk-integration-frontend-try.md): Sign in, reload and sign out.
4. [Go live](/sdk-integration-frontend-go-live.md)

**PHP, Python, .NET, Node.js**

1. [Before you start](/sdk-integration-server.md)
2. [Install the client](/sdk-integration-server-install.md): Set up your environment variables and install the Block-Auth client for your language.
3. [Login](/sdk-integration-server-login.md): Add the login routes, link your pages and try it.
4. [Go live](/sdk-integration-server-go-live.md)

**WordPress**

1. [Before you start](/sdk-integration-wordpress.md)
2. [Install the plugin](/sdk-integration-wordpress-install.md): Upload and activate the Block-Auth Login plugin.
3. [Connect it](/sdk-integration-wordpress-connect.md): Connect your keys, choose the login and try it.
4. [Go live](/sdk-integration-wordpress-go-live.md)

### Working with the developer

Before writing code, find out or ask:

- The stack: frontend framework and build tool, backend language and framework, whether frontend and backend share one project.
- Whether the app already has its own login, and where its session and its "who am I" route live.
- The port the backend already listens on, and the URL where the frontend opens (the App URL).
- Whether the app already exists in the Block-Auth Dashboard, and its API Key (public). Development and production have different keys.

Never ask for the API Secret or the `SESSION_SECRET` in the conversation, and never write them into code or commit them. Tell the developer which environment variable to set and how to generate `SESSION_SECRET` (`openssl rand -hex 32`), and check that `.env` is in `.gitignore`.

While implementing:

- Read the existing server first: where the app is created, its session, its body parsers, how it loads variables and how its tests build it. Add the Block-Auth lines into that structure instead of replacing it with the examples' full server.
- Keep every Block-Auth value in the app's existing configuration (for example its config module), not scattered `process.env` reads.
- Keep the app's lint and tests passing; give the tests test values, never real keys.

When you finish, tell the developer: the files you changed, the variables they must set and where, the exact steps to try it (the definition of done above) and the optional next steps (webhooks, using the session in their routes, going live). If something fails, ask for the exact error line from the browser console and the backend console, with a `logger` passed to `BlockAuthRoutes`, and match it in [Troubleshooting](/troubleshooting.md).
