> For the complete documentation index, see [llms.txt](https://timechain.gitbook.io/neucron-javascript-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://timechain.gitbook.io/neucron-javascript-sdk/identity-and-access/authentication.md).

# Authentication

Accessor: `sdk.auth`

Sign up, log in, store tokens, validate sessions, update profile data, and manage password flows.

## Method surface

| Method                      | Purpose        |
| --------------------------- | -------------- |
| `sdk.auth.getToken()`       | getToken       |
| `sdk.auth.getHttpClient()`  | getHttpClient  |
| `sdk.auth.setToken()`       | setToken       |
| `sdk.auth.validate()`       | validate       |
| `sdk.auth.signUp()`         | signUp         |
| `sdk.auth.login()`          | login          |
| `sdk.auth.logout()`         | logout         |
| `sdk.auth.emailExists()`    | emailExists    |
| `sdk.auth.phoneExists()`    | phoneExists    |
| `sdk.auth.forgotPassword()` | forgotPassword |
| `sdk.auth.updatePassword()` | updatePassword |
| `sdk.auth.userInfo()`       | userInfo       |
| `sdk.auth.updateUser()`     | updateUser     |

## Basic usage

```typescript
const sdk = new NeucronSDK();

await sdk.auth.login({ email: process.env.NEUCRON_EMAIL!, password: process.env.NEUCRON_PASSWORD! });
const profile = await sdk.auth.userInfo();
```

## Notes

* Methods return `Promise<HttpResponse<T>>` unless they are local helpers such as token getters/setters.
* Authenticate with `sdk.auth.login()` or initialize with `authToken` before protected calls.
* Pass `businessId` on business-scoped operations; constructor-level `businessId` is typed but not applied globally.
* Request and response schemas are exported from `@timechainlabs/neucron-ts-sdk` and `@timechainlabs/neucron-ts-sdk/schemas`.
