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

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

#### Parameters

##### dataDir

`string`

#### Returns

`FileAuthSessionBackend`

## Methods

### clearAll()

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

Defined in: [packages/b2c-tooling-sdk/src/auth/session-store.ts:130](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/b0472c439ca6570be5c7809783a46327d7493694/packages/b2c-tooling-sdk/src/auth/session-store.ts#L130)

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

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

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

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

#### Parameters

##### session

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

#### Returns

`void`

#### Implementation of

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