# routes/joy-token

> Source: https://devdocs.joy.so/joy-headless-api/sdk-reference/weaverse-hydrogen/routes/joy-token/ · Last updated: 2026-11-24

## Interfaces

### JoyCustomerAccount

#### Methods

##### isLoggedIn()

```ts
isLoggedIn(): Promise<boolean>;
```

###### Returns

`Promise`<`boolean`>

##### query()

```ts
query(query, options?): Promise<{
  data?:   | {
     customer?:   | {
        emailAddress?:   | {
           emailAddress?: string | null;
         }
           | null;
        firstName?: string | null;
        id?: string | null;
        lastName?: string | null;
      }
        | null;
   }
     | null;
  errors?: unknown;
}>;
```

###### Parameters

| Parameter  | Type      |
| ---------- | --------- |
| `query`    | `string`  |
| `options?` | `unknown` |

###### Returns

`Promise`<{
`data?`:   | {
`customer?`:   | {
`emailAddress?`:   | {
`emailAddress?`: `string` | `null`;
}
\| `null`;
`firstName?`: `string` | `null`;
`id?`: `string` | `null`;
`lastName?`: `string` | `null`;
}
\| `null`;
}
\| `null`;
`errors?`: `unknown`;
}>

***

### JoyTokenContext

#### Properties

##### customerAccount

```ts
customerAccount: JoyCustomerAccount;
```

##### env

```ts
env: JoyTokenEnv;
```

***

### JoyTokenEnv

#### Properties

##### JOY_API_SECRET?

```ts
JOY_API_SECRET?: string;
```

##### JOY_API_URL?

```ts
JOY_API_URL?: string;
```

##### JOY_SHOP_DOMAIN?

```ts
JOY_SHOP_DOMAIN?: string;
```

***

### JoyTokenLoaderArgs

#### Properties

##### context

```ts
context: JoyTokenContext;
```

##### request?

```ts
request?: Request;
```

## Functions

### loader()

```ts
function loader(__namedParameters): Promise<Response>;
```

#### Parameters

| Parameter           | Type                                        |
| ------------------- | ------------------------------------------- |
| `__namedParameters` | [`JoyTokenLoaderArgs`](#joytokenloaderargs) |

#### Returns

`Promise`<`Response`>
