> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neus.network/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK authentication

> Sign people in on NEUS. Authenticate your server with a key or gate check.

Default: no wallet or passkey code in your app. Visitors sign in or complete checks on `neus.network/verify` via `VerifyGate`, `getHostedCheckoutUrl`, or MCP OAuth.

| Where                      | What                                              | Wallet code in your app                                |
| -------------------------- | ------------------------------------------------- | ------------------------------------------------------ |
| Browser — access gate      | `VerifyGate` + `gateId`                           | No                                                     |
| Browser — sign-in          | `getHostedCheckoutUrl` + `intent: 'login'`        | No                                                     |
| Server                     | `NeusClient` + `gateCheck` with the same `gateId` | No                                                     |
| Automation as your profile | `NeusClient` + profile access key (`npk_*`)       | No                                                     |
| Advanced server            | `verifyFromApp` after per-user approval           | No                                                     |
| Browser (exception)        | `client.verify({ wallet })`                       | Yes — [Signing format](../verification/signing-format) |

## VerifyGate (browser)

```jsx theme={"dark"}
import { VerifyGate } from '@neus/sdk/widgets';

<VerifyGate gateId="gate_your-app-name">
  <ProtectedContent />
</VerifyGate>;
```

## Hosted Verify (browser)

[Hosted Verify](../cookbook/auth-hosted-verify).

```javascript theme={"dark"}
import { getHostedCheckoutUrl } from '@neus/sdk';

const url = getHostedCheckoutUrl({
  gateId: 'gate_your-app-name',
  returnUrl: 'https://yourapp.com/auth/callback',
});
```

**Sign-in only:**

```javascript theme={"dark"}
const loginUrl = getHostedCheckoutUrl({
  intent: 'login',
  returnUrl: 'https://yourapp.com/auth/callback',
});
```

## Server reuse

```javascript theme={"dark"}
import { NeusClient } from '@neus/sdk';

const client = new NeusClient();

const result = await client.gateCheck({
  gateId: 'gate_your-app-name',
  address: user.accountAddress,
});

if (result.data?.gate?.allRequiredSatisfied !== true) {
  // Send the visitor back to VerifyGate or Hosted Verify
}
```

## Profile access keys

For servers, CI, and MCP when browser sign-in is unavailable. Create keys under [Profile → Account](https://neus.network/profile?tab=account).

```javascript theme={"dark"}
import { NeusClient } from '@neus/sdk';

// Server only — never ship npk_* in a browser bundle
const client = new NeusClient({ apiKey: process.env.NEUS_ACCESS_KEY });
```

The SDK sends `Authorization: Bearer <npk_...>`.

## IDE and MCP sign-in

Run `neus setup`. Default is browser OAuth. Set `NEUS_ACCESS_KEY` first only for servers and CI.

See [MCP setup](../mcp/setup).

## Advanced: `verifyFromApp`

After one-time user approval ([app link](../agents/agent-delegation)), your backend can create receipts without a per-request signature:

```javascript theme={"dark"}
const client = new NeusClient({
  appId: 'acme-web',
  appOrigin: 'https://yourapp.com',
  apiKey: process.env.NEUS_ACCESS_KEY, // optional — your builder profile
});

await client.verifyFromApp({
  user: { walletAddress: user.accountAddress },
  verifier: 'ownership-basic',
  content: 'Hello NEUS',
});
```

Full detail: [Integrations](../cookbook/integrations).

## Advanced

[API authentication](../api/authentication)
