# Auth Controller \[INTERNAL]

```typescript
import { AuthController } from "tria-sdk-core";
const authContoller = new AuthController({ baseUrl: "http://localhost:8000" });
```

## InitiateOTP

```typescript
async initiateOTP(input: string)
```

input is email or phone number (phone number with country code)

Response example:-

```json
{
    "message": "OTP sent to email.",
    "session": "AYABeJWTbdx1JyNzJMlWjtWe6vMAHQABAAdTZXJ2aWNlABBDb2duaXRvVXNlclBvb2xzAAEAB2F3cy1rbXMAS2Fybjphd3M6a21zOnVzLWVhc3QtMTo3NDU2MjM0Njc1NTU6a2V5L2IxNTVhZmNhLWJmMjktNGVlZC1hZmQ4LWE5ZTA5MzY1M2RiZQC4AQIBAHgDHnKSW2nDRJSDSLf55TGFyX5On_wV32whMfiMxuCEIAHRuh9pIDdMfyVoBBP0j8D0AAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQM4ffYKPSM9Na_7usQAgEQgDvITFFvxt54eUsbPgvyZYCt8TcbEExk7W9cUi2GCNLvOb5QKqD9w4ho7PORkot_2TSBuLzTfQI6DqMyjgIAAAAADAAAEAAAAAAAAAAAAAAAAAAJJsoh_C0HFf3LlsMoqIKW_____wAAAAEAAAAAAAAAAAAAAAEAAAEXbvg8xqYvmrBbj73Lgq6iDIUOOK6ybT5G86A36NJCRUqu6YnDxgLUNdHoMc0fKRztbOL7V-maf2ivNH6shY6eoEBnx0xNlymv2cgApXRnsLaKvZNXr5Psc7xvlF6PvKVZ3_jxbaBqNntBwMkSTAg9cY0OFSvU4GGOB9YBlpIEZntPNyiq26bKoniFMEeG4eeuNwF7QWeu6U3qDiboNq56G_vJ5D2hkdeqQ6b9P5_szhSi3JitbwldM8FvKpzz6-qQSPkohwEwz_ShzS418gr9UR2P_2nX3yuMAMwnhezvnTnqHDxI0lDpoHtoVErdw_tBYtcxtsfR5876jwX2WFCTBc_VdXY08Poci425ORJMvMZZXXpgAfwGDCrfbxtvL1eYS1f4BY-3gA"
}
```

## Verify OTP

```typescript
async verifyOTP({ otp, session, input }: { input: string, session: string, otp: string }) 
```

## Logout

```typescript
async logout(): Promise<LogoutResponse>
```

```typescript
interface LogoutResponse {
    message: string,
    success: boolean
}
```

## SendOTP (stytch)

```typescript
async sendOTP(userId: string, method: string)
```

userId: email or phoneNumber\
method: 'email' or 'phone\_number'

## VerifyOTP (stytch)

```typescript
async verifyOTP(code: string, methodId: string)
```

code: OTP\
methodId: it will return from sendOTP responsec

## Setup Pin

```typescript
async setupPin({ accessToken, pin, idToken }: { accessToken: string, pin?: string, idToken?: string }): <SetupResponse>
```

```typescript
interface SetupResponse {
    success: boolean
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-priv.tria.so/reference/onboarding-and-wallet-sdk/tria-sdk-core/auth-controller-internal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
