# @vendasta/session-service

> Session Service for frontend components to use.

Latest version **1.0.2** (published 2017-06-21) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @vendasta/session-service
pnpm add @vendasta/session-service
yarn add @vendasta/session-service
bun add @vendasta/session-service
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-06-21 |
| First published | 2017-06-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| Author | Vendasta R&D |
| Maintainers | vendasta |

## Links

- npm: https://www.npmjs.com/package/@vendasta/session-service
- npm.io page: https://npm.io/package/@vendasta/session-service

## Dependencies (4)

- [rxjs](https://npm.io/package/rxjs.md) ^5.0.0
- [core-js](https://npm.io/package/core-js.md) ^2.0.0
- [zone.js](https://npm.io/package/zone.js.md) ^0.8.0
- [@angular/core](https://npm.io/package/@angular/core.md) ^4.0.0

## Recent versions

- 1.0.2 (latest) — 2017-06-21
- 1.0.1 — 2017-06-14
- 1.0.0 — 2017-06-08

## README

# Session Service

This provides a service for other components to use to retrieve session information.

## Requirements

The Session Service interface:

```typescript
export interface SessionServiceInterface {
  getSessionId(): Observable<string>;
}
```

To implement the interface make a new service that implements the interface:

```typescript
…
import {SessionServiceInterface} from '@vendasta/session-service';

@Injectable()
export class SessionService implements SessionServiceInterface {
  …
  getSessionId(): Observable<string> {
    // Implement how the project determines the session id
  }
}
```

Next you will need to provide your service as that interface (generally in `app.module.ts`)

```typescript
import { SessionService } from './session.service';
import { SessionServiceInterfaceToken } from '@vendasta/session-service';
…
@NgModule({
  …
  providers: [
    SessionService, {provide: SessionServiceInterfaceToken, useExisting: SessionService}
  ],
})
```

* Note: To be able to inject an interface, you will have to provide the InjectionToken and not the interface itself (`SessionServiceInterfaceToken` vs `SessionServiceInterface`).

---
_Source: https://npm.io/package/@vendasta/session-service · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
