Skip to content

Commit 1dac3c5

Browse files
committed
chore: prepare v0.1.0 release
- Add READMEs to core and plugins packages - Fix pnpm version conflicts in workflows - Add release banner to docs homepage
1 parent 40ef353 commit 1dac3c5

File tree

10 files changed

+346
-7
lines changed

10 files changed

+346
-7
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ jobs:
1818
- uses: actions/checkout@v4
1919

2020
- name: Setup pnpm
21-
uses: pnpm/action-setup@v3
22-
with:
23-
version: 10
21+
uses: pnpm/action-setup@v4
2422

2523
- name: Use Node.js ${{ matrix.node-version }}
2624
uses: actions/setup-node@v4

.github/workflows/docs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ jobs:
3232

3333
- name: Setup pnpm
3434
uses: pnpm/action-setup@v4
35-
with:
36-
version: 10
3735

3836
- name: Get pnpm store directory
3937
shell: bash

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
fetch-depth: 0
4040

4141
- name: Setup pnpm
42-
uses: pnpm/action-setup@v3
42+
uses: pnpm/action-setup@v4
4343

4444
- name: Setup Node.js
4545
uses: actions/setup-node@v4

docs/components/ReleaseBanner.tsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { latestVersion } from '../content/latest-version';
2+
3+
export function ReleaseBanner() {
4+
return (
5+
<div
6+
style={{
7+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
8+
color: 'white',
9+
padding: '24px',
10+
borderRadius: '12px',
11+
marginTop: '24px',
12+
marginBottom: '32px',
13+
}}
14+
>
15+
<div style={{ fontSize: '24px', fontWeight: 'bold', marginBottom: '8px' }}>
16+
🎉 v{latestVersion.version} Released!
17+
</div>
18+
<div style={{ fontSize: '16px', opacity: 0.95, marginBottom: '12px' }}>
19+
{latestVersion.summary}
20+
</div>
21+
<div style={{ fontSize: '14px', opacity: 0.9 }}>
22+
{latestVersion.features.map((feature, i) => (
23+
<span key={i}>
24+
{i > 0 && ' • '}
25+
{feature}
26+
</span>
27+
))}
28+
</div>
29+
<div style={{ marginTop: '16px', fontSize: '14px' }}>
30+
<code
31+
style={{
32+
background: 'rgba(255,255,255,0.2)',
33+
padding: '8px 12px',
34+
borderRadius: '6px',
35+
fontFamily: 'monospace',
36+
}}
37+
>
38+
npm install @prosdevlab/experience-sdk
39+
</code>
40+
</div>
41+
</div>
42+
);
43+
}

docs/content/latest-version.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Latest version information
3+
* Update this file when releasing a new version
4+
*/
5+
6+
export const latestVersion = {
7+
version: '0.1.0',
8+
title: 'Initial Release',
9+
date: 'December 26, 2024',
10+
summary:
11+
'Experience SDK is now available on npm with multiple button variants, frequency capping, and responsive layout. Only 6.9 KB gzipped.',
12+
features: [
13+
'Multiple buttons with variants (primary, secondary, link)',
14+
'Responsive layout (desktop inline, mobile stack)',
15+
'Frequency capping per session/day/week',
16+
'Complete TypeScript support',
17+
'Only 6.9 KB gzipped',
18+
],
19+
} as const;

docs/pages/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Experience SDK
22

3+
import { ReleaseBanner } from '../components/ReleaseBanner';
4+
35
A lightweight, explainable, plugin-based client-side experience runtime built on [@lytics/sdk-kit](https://github.com/Lytics/sdk-kit).
46

7+
<ReleaseBanner />
8+
59
## Key Features
610

711
- **Explainability-First** - Every decision returns structured reasons

packages/core/README.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# @prosdevlab/experience-sdk
2+
3+
A lightweight, explainable client-side experience runtime built on [@lytics/sdk-kit](https://github.com/lytics/sdk-kit).
4+
5+
**Size:** 6.9 KB gzipped (includes core + 3 plugins)
6+
7+
## Features
8+
9+
- **Explainability-First** - Every decision includes structured reasons
10+
- **Plugin-Based** - Built on sdk-kit's powerful plugin system
11+
- **Multiple Buttons** - Primary, secondary, and link variants
12+
- **Frequency Capping** - Control impression limits per session/day/week
13+
- **Responsive Layout** - Automatically adapts to mobile/desktop
14+
- **Script Tag Ready** - Works without build tools
15+
- **Type-Safe** - Full TypeScript support
16+
17+
## Installation
18+
19+
### npm
20+
21+
```bash
22+
npm install @prosdevlab/experience-sdk
23+
```
24+
25+
### Script Tag
26+
27+
```html
28+
<script src="https://unpkg.com/@prosdevlab/experience-sdk/dist/experience-sdk.global.js"></script>
29+
```
30+
31+
## Quick Start
32+
33+
### For Bundlers (ESM)
34+
35+
```typescript
36+
import { createInstance } from '@prosdevlab/experience-sdk';
37+
38+
// Create instance
39+
const experiences = createInstance({ debug: true });
40+
41+
// Initialize
42+
await experiences.init();
43+
44+
// Register a banner
45+
experiences.register('welcome', {
46+
type: 'banner',
47+
targeting: {
48+
url: { contains: '/' }
49+
},
50+
content: {
51+
title: 'Welcome!',
52+
message: 'Thanks for visiting.',
53+
buttons: [
54+
{ text: 'Get Started', url: '/start', variant: 'primary' }
55+
]
56+
},
57+
frequency: {
58+
max: 3,
59+
per: 'session'
60+
}
61+
});
62+
63+
// Evaluate and show
64+
const decision = experiences.evaluate();
65+
console.log(decision.reasons);
66+
```
67+
68+
### For Script Tag
69+
70+
```html
71+
<script src="https://unpkg.com/@prosdevlab/experience-sdk/dist/experience-sdk.global.js"></script>
72+
<script>
73+
// Global 'experiences' available
74+
experiences.init({ debug: true });
75+
76+
experiences.register('cookie-consent', {
77+
type: 'banner',
78+
content: {
79+
message: 'We use cookies to improve your experience',
80+
buttons: [
81+
{ text: 'Accept', action: 'accept', variant: 'primary' },
82+
{ text: 'Reject', action: 'reject', variant: 'secondary' }
83+
],
84+
position: 'bottom'
85+
}
86+
});
87+
88+
experiences.evaluate();
89+
</script>
90+
```
91+
92+
## Multiple Buttons
93+
94+
Banners support multiple buttons with visual variants:
95+
96+
```typescript
97+
buttons: [
98+
{ text: 'Accept all', variant: 'primary', action: 'accept' },
99+
{ text: 'Reject', variant: 'secondary', action: 'reject' },
100+
{ text: 'Preferences', variant: 'link', url: '/preferences' }
101+
]
102+
```
103+
104+
- **primary** - Blue button for main actions
105+
- **secondary** - Gray outlined button for secondary actions
106+
- **link** - Text link style for tertiary actions
107+
108+
## Events
109+
110+
Listen to experience interactions:
111+
112+
```typescript
113+
// Banner shown
114+
experiences.on('experiences:shown', ({ experienceId }) => {
115+
console.log('Shown:', experienceId);
116+
});
117+
118+
// Button clicked
119+
experiences.on('experiences:action', ({ experienceId, action, variant, metadata }) => {
120+
analytics.track('Experience Action', { experienceId, action });
121+
});
122+
123+
// Banner dismissed
124+
experiences.on('experiences:dismissed', ({ experienceId }) => {
125+
console.log('Dismissed:', experienceId);
126+
});
127+
```
128+
129+
## Included Plugins
130+
131+
This package includes three official plugins:
132+
133+
- **Banner Plugin** - DOM rendering with responsive layout
134+
- **Frequency Plugin** - Impression tracking and capping
135+
- **Debug Plugin** - Logging and window events
136+
137+
## Documentation
138+
139+
- [Full Documentation](https://prosdevlab.github.io/experience-sdk)
140+
- [API Reference](https://prosdevlab.github.io/experience-sdk/reference)
141+
- [Plugins Guide](https://prosdevlab.github.io/experience-sdk/reference/plugins)
142+
- [Examples](https://prosdevlab.github.io/experience-sdk/demo)
143+
144+
## License
145+
146+
MIT
147+

packages/core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"./dist/experience-sdk.global.js": "./dist/experience-sdk.global.js"
1616
},
1717
"files": [
18-
"dist"
18+
"dist",
19+
"README.md"
1920
],
2021
"keywords": [
2122
"experience",

packages/plugins/README.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# @prosdevlab/experience-sdk-plugins
2+
3+
Official plugins for [Experience SDK](https://github.com/prosdevlab/experience-sdk).
4+
5+
**Size:** 13.4 KB (ESM)
6+
7+
## Included Plugins
8+
9+
### Banner Plugin
10+
11+
Renders banner experiences in the DOM with automatic positioning, theming, and responsive layout.
12+
13+
**Features:**
14+
- Multiple buttons with variants (primary, secondary, link)
15+
- Responsive layout (desktop inline, mobile stack)
16+
- Automatic theme detection (light/dark mode)
17+
- Top/bottom positioning
18+
- Dismissable with close button
19+
20+
```typescript
21+
import { createInstance, bannerPlugin } from '@prosdevlab/experience-sdk-plugins';
22+
23+
const sdk = createInstance();
24+
sdk.use(bannerPlugin);
25+
26+
sdk.banner.show({
27+
id: 'welcome',
28+
type: 'banner',
29+
content: {
30+
title: 'Welcome!',
31+
message: 'Thanks for visiting.',
32+
buttons: [
33+
{ text: 'Get Started', url: '/start', variant: 'primary' }
34+
],
35+
position: 'top',
36+
dismissable: true
37+
}
38+
});
39+
```
40+
41+
### Frequency Plugin
42+
43+
Manages impression tracking and frequency capping with persistent storage.
44+
45+
**Features:**
46+
- Session/day/week impression tracking
47+
- Automatic storage management
48+
- Manual impression recording
49+
- Reset capabilities
50+
51+
```typescript
52+
import { createInstance, frequencyPlugin } from '@prosdevlab/experience-sdk-plugins';
53+
54+
const sdk = createInstance();
55+
sdk.use(frequencyPlugin);
56+
57+
// Check impression count
58+
const count = sdk.frequency.getImpressionCount('welcome', 'session');
59+
60+
// Record impression
61+
sdk.frequency.recordImpression('welcome');
62+
63+
// Reset counts
64+
sdk.frequency.reset('welcome');
65+
```
66+
67+
### Debug Plugin
68+
69+
Provides console logging and window event emission for debugging and Chrome extension integration.
70+
71+
**Features:**
72+
- Console logging with prefix
73+
- Window event emission
74+
- Automatic decision logging
75+
- Configurable logging levels
76+
77+
```typescript
78+
import { createInstance, debugPlugin } from '@prosdevlab/experience-sdk-plugins';
79+
80+
const sdk = createInstance({ debug: true });
81+
sdk.use(debugPlugin);
82+
83+
// Manual logging
84+
sdk.debug.log('Custom message', { foo: 'bar' });
85+
86+
// Listen to debug events
87+
window.addEventListener('experiences:debug', (event) => {
88+
console.log(event.detail);
89+
});
90+
```
91+
92+
## Installation
93+
94+
```bash
95+
npm install @prosdevlab/experience-sdk-plugins
96+
```
97+
98+
Or use the main package which includes these plugins:
99+
100+
```bash
101+
npm install @prosdevlab/experience-sdk
102+
```
103+
104+
## Usage
105+
106+
These plugins are automatically included when using `@prosdevlab/experience-sdk`. You only need this package if you want to use the plugins separately with a custom sdk-kit setup.
107+
108+
```typescript
109+
import { createInstance } from '@prosdevlab/experience-sdk';
110+
111+
// Plugins are already included and available
112+
const experiences = createInstance({ debug: true });
113+
experiences.register('banner', { ... });
114+
```
115+
116+
## Documentation
117+
118+
- [Full Documentation](https://prosdevlab.github.io/experience-sdk)
119+
- [Plugins Guide](https://prosdevlab.github.io/experience-sdk/reference/plugins)
120+
- [Banner Examples](https://prosdevlab.github.io/experience-sdk/demo/banner)
121+
122+
## License
123+
124+
MIT
125+

packages/plugins/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
"import": "./dist/index.js"
1313
}
1414
},
15+
"files": [
16+
"dist",
17+
"README.md"
18+
],
1519
"scripts": {
1620
"build": "tsup",
1721
"dev": "tsup --watch",

0 commit comments

Comments
 (0)