0.2.0 • Published 1 year ago
@analytics/session-utils v0.2.0
Session Utilities
A tiny session utility library in 775 bytes
.
- Persisted Sessions - saved as cookie for 30min
getSession
setSession
- Tab Sessions - saved until tab/window closed
getTabSession
setTabSession
- Page Sessions - saved until page changes
getPageSession
setPageSession
Example
import { getSession, setSession } from '@analytics/session-utils'
const currentSession = getSession()
console.log('currentSession', currentSession)
// Update session
const newSessionInfo = setSession()
console.log('newSessionInfo', newSessionInfo)
About
┌─────────────────────────────────────────────────────────────────┐
│ Persisted Session │
│ │
│ ┌──────────────────────────┐ ┌──────────────────────────┐ │
│ │ Tab Session │ │ Tab Session │ │
│ │ │ │ │ │
│ │ ┌────────────────────┐ │ │ ┌────────────────────┐ │ │
│ │ │ Page Session │ │ │ │ Page Session │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ └────────────────────┘ │ │ └────────────────────┘ │ │
│ └──────────────────────────┘ └──────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
0.2.0
1 year ago
0.1.18
2 years ago
0.1.19
2 years ago
0.1.17
3 years ago
0.1.13
4 years ago
0.1.14
3 years ago
0.1.15
3 years ago
0.1.16
3 years ago
0.1.11
4 years ago
0.1.12
4 years ago
0.1.10
4 years ago
0.1.9
4 years ago
0.1.7
4 years ago
0.1.6
4 years ago
0.1.5
4 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.2
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago