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

# AuthLinks

[@qonto/embed-sdk](../README) / authLinks

# Variable: authLinks

> `const` **authLinks**: `object`

The authLinks namespace contains all the client-side functions related to authentication link operations.
This version uses proxy-based authentication (proxyEndpointDescriptor)
and is designed for browser environments.

For server-side operations using access tokens, import from '@qonto/embed-sdk/server/auth-links'.

It can be accessed like this:

```ts theme={null}
import { authLinks } from '@qonto/embed-sdk/auth-links';
```

Then, the authLinks object contains the functions to perform auth link operations:

```ts theme={null}
await authLinks.request({
  requestSettings: {
    action: AUTH_LINK_ACTIONS.CARD_DISPLAY,
  },
  operationSettings: {
    proxyEndpointDescriptor: {
      path: '/api/qonto-proxy',
      method: 'POST',
      options: {},
    },
  }
});
```

## Type declaration

### request()

> **request**: (`requestAuthLinkParams`) => `Promise`\<[`AuthLinkRequestResult`](../interfaces/AuthLinkRequestResult)>

**Client-side implementation** - Requests an authentication link for a specific action.

Auth links allow loading embed features or performing Embed actions in a secure manner
while still avoiding exposing the access token to the client side.

This implementation uses a proxy-based flow (via proxyEndpointDescriptor),
which is designed for client-side environments where access tokens should not
be exposed.

#### Parameters

##### requestAuthLinkParams

[`AuthLinkClientParams`](../-internal-/interfaces/AuthLinkClientParams)

An object containing:

* `requestSettings`: An object with the `action` and an optional `callbackUrl`
  properties (both string).
* `operationSettings`: An object with operation-level settings. Must include
  `proxyEndpointDescriptor`. See [ClientOperationSettings](../-internal-/interfaces/ClientOperationSettings).

#### Returns

`Promise`\<[`AuthLinkRequestResult`](../interfaces/AuthLinkRequestResult)>

Promise resolving to the auth link details, which includes the URL
where the user should be redirected to perform the action, the requested action,
the callback URL if it was provided, the expiration time of the link, and the
time it was used.

#### Throws

`InvalidParametersError` - If the request settings are invalid or if
proxyEndpointDescriptor is not provided.

#### Example

```typescript theme={null}
import { authLinks } from '@qonto/embed-sdk/auth-links';
import { AUTH_LINK_ACTIONS } from '@qonto/embed-sdk/constants';

const result = await authLinks.request({
  requestSettings: {
    action: AUTH_LINK_ACTIONS.DISPLAY_CARD,
  },
  operationSettings: {
    proxyEndpointDescriptor: {
      path: '/api/qonto-proxy',
      method: 'POST',
    },
  }
});

console.log('Auth link URL:', result.url);
// Use the URL to load the requested UI element (e.g., in an iframe, modal, or new window)
```

#### See

For server-side implementation with accessToken, import from `@qonto/embed-sdk/server/auth-links`
