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

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

# Class: FileAuthSessionBackend

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

Default JSON-file-backed implementation. Path defaults to
`<oclif data dir>/auth-sessions.json`. Atomic writes via tmp + rename.

## Implements

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

## Constructors

### Constructor

> **new FileAuthSessionBackend**(`dataDir`): `FileAuthSessionBackend`

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

#### Parameters

##### dataDir

`string`

#### Returns

`FileAuthSessionBackend`

## Methods

### clearAll()

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

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

#### 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:111](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/auth/session-store.ts#L111)

#### 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:95](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/auth/session-store.ts#L95)

#### 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:119](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/auth/session-store.ts#L119)

#### 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:99](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/auth/session-store.ts#L99)

#### Parameters

##### session

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

#### Returns

`void`

#### Implementation of

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