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

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

# Class: InMemoryAuthSessionBackend

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:180](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/auth/session-store.ts#L180)

In-memory backend, useful for tests and for IDE adapters that hydrate from
async native storage at startup and write through asynchronously.

## Implements

- [`AuthSessionBackend`](../interfaces/AuthSessionBackend.md)

## Constructors

### Constructor

> **new InMemoryAuthSessionBackend**(): `InMemoryAuthSessionBackend`

#### Returns

`InMemoryAuthSessionBackend`

## Methods

### clearAll()

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

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:199](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/auth/session-store.ts#L199)

#### Returns

`void`

#### Implementation of

[`AuthSessionBackend`](../interfaces/AuthSessionBackend.md).[`clearAll`](../interfaces/AuthSessionBackend.md#clearall)

***

### delete()

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

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:191](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/auth/session-store.ts#L191)

#### Parameters

##### clientId

`string`

#### Returns

`void`

#### Implementation of

[`AuthSessionBackend`](../interfaces/AuthSessionBackend.md).[`delete`](../interfaces/AuthSessionBackend.md#delete)

***

### find()

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

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:183](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/auth/session-store.ts#L183)

#### Parameters

##### clientId

`string`

#### Returns

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

#### Implementation of

[`AuthSessionBackend`](../interfaces/AuthSessionBackend.md).[`find`](../interfaces/AuthSessionBackend.md#find)

***

### list()

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

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:195](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/auth/session-store.ts#L195)

#### Returns

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

#### Implementation of

[`AuthSessionBackend`](../interfaces/AuthSessionBackend.md).[`list`](../interfaces/AuthSessionBackend.md#list)

***

### save()

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

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:187](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/auth/session-store.ts#L187)

#### Parameters

##### session

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

#### Returns

`void`

#### Implementation of

[`AuthSessionBackend`](../interfaces/AuthSessionBackend.md).[`save`](../interfaces/AuthSessionBackend.md#save)
