open-index/open-npm huggingface dataset:
npm package: @flash-analytics/astro
Description: Read full documentation [here](https://flashanalytics.app/docs/sdks/astro)
Latest version: 2.1.4

# FlashAnalytics Astro SDK

Read full documentation [here](https://flashanalytics.app/docs/sdks/astro)

This package re-exports the web SDK and now exposes the same `assignExperiment(...)`
helper as the other framework wrappers.

## Session access

```ts
import { getSession } from '@flash-analytics/astro';

const session = getSession();

console.log(session?.id);
console.log(session?.estimatedExpiresAt);
console.log(session?.estimatedTtlMs);
```
npm package: @flash-analytics/nextjs
Description: If you are using the browser helpers:
Latest version: 2.1.6

# Flash Analytics Next.js SDK

## Session access

If you are using the browser helpers:

```ts
'use client';

import { useFlashAnalytics } from '@flash-analytics/nextjs';

const analytics = useFlashAnalytics();
const session = analytics.getSession();

console.log(session?.id);
console.log(session?.estimatedExpiresAt);
console.log(session?.estimatedTtlMs);
```

This reads the current client-side session maintained by the underlying web SDK.
npm package: @flash-analytics/react-native
Description: ```ts import { FlashAnalytics } from '@flash-analytics/react-native';
Latest version: 2.1.6

# Flash Analytics React Native SDK

## Session access

```ts
import { FlashAnalytics } from '@flash-analytics/react-native';

const analytics = new FlashAnalytics({
  appId: 'your-app-id',
});

await analytics.track('page_view');

const session = analytics.getSession();

console.log(session?.id);
console.log(session?.estimatedExpiresAt);
console.log(session?.estimatedTtlMs);
```

Use `getSession()` when you need both the session id and its estimated expiry.
npm package: @flash-analytics/sdk
Description: This package is the shared JavaScript SDK used by the web, Next.js, and React Native wrappers.
Latest version: 2.1.5

# Flash Analytics Core SDK

This package is the shared JavaScript SDK used by the web, Next.js, and React Native wrappers.

## Session access

After any successful `track(...)` call, you can read the active session and its estimated expiry:

```ts
import { FlashAnalytics } from '@flash-analytics/sdk';

const analytics = new FlashAnalytics({
  appId: 'your-app-id',
});

await analytics.track('page_view');

const session = analytics.getSession();

console.log(session?.id);
console.log(session?.estimatedExpiresAt);
console.log(session?.estimatedTtlMs);
```

`getSessionId()` still works if you only need the id.

## Identify payloads

If an active session already exists, the SDK automatically attaches it when you call `identify(...)`.

```ts
await analytics.identify({
  profileId: 'user-123',
  email: 'user@example.com',
});
```
npm package: @flash-analytics/web
Description: After a `track(...)` call, read the current session from the SDK with a single method:
Latest version: 2.1.5

# Flash Analytics Web SDK

## Session access

After a `track(...)` call, read the current session from the SDK with a single method:

```ts
import { FlashAnalytics } from '@flash-analytics/web';

const analytics = new FlashAnalytics({
  appId: 'your-app-id',
});

await analytics.track('page_view');

const session = analytics.getSession();

console.log(session?.id);
console.log(session?.estimatedExpiresAt);
console.log(session?.estimatedTtlMs);
```

`getSessionId()` still works, but `getSession()` is the preferred API when you also need expiry information.