---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [auth](../index.md) / AuthSessionBackend

# Interface: AuthSessionBackend

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:83](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/session-store.ts#L83)

Pluggable backend for the unified auth-session store. Synchronous on the
read path so command initialization can decide auth flow without awaiting.
Backends with async-only native storage (VS Code SecretStorage, OS keychain)
maintain an in-memory snapshot hydrated at startup and persist writes
asynchronously; implementations may expose a backend-specific flush hook for
orderly shutdown.

## Methods

### clearAll()

> **clearAll**(): `void`

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:88](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/session-store.ts#L88)

#### Returns

`void`

***

### delete()

> **delete**(`clientId`): `void`

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:86](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/session-store.ts#L86)

#### Parameters

##### clientId

`string`

#### Returns

`void`

***

### find()

> **find**(`clientId`): [`AuthSession`](AuthSession.md) \| `null`

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:84](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/session-store.ts#L84)

#### Parameters

##### clientId

`string`

#### Returns

[`AuthSession`](AuthSession.md) \| `null`

***

### flush()?

> `optional` **flush**(): `Promise`\<`void`\>

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:93](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/session-store.ts#L93)

Waits for pending asynchronous writes to finish. Optional; the CLI calls it
before the process exits so write-behind backends do not lose sessions.

#### Returns

`Promise`\<`void`\>

***

### list()

> **list**(): [`AuthSession`](AuthSession.md)[]

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:87](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/session-store.ts#L87)

#### Returns

[`AuthSession`](AuthSession.md)[]

***

### save()

> **save**(`session`): `void`

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:85](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/1cc5681b8c76554833dc7a40097f33641882a372/packages/b2c-tooling-sdk/src/auth/session-store.ts#L85)

#### Parameters

##### session

[`AuthSession`](AuthSession.md)

#### Returns

`void`
