@makeco/stripe-kit 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -176
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,139 +1,45 @@
|
|
|
1
1
|
# stripe-kit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://github.com/makeco/stripe-kit/issues)
|
|
6
|
-
[](https://github.com/makeco/stripe-kit/stargazers)
|
|
7
|
-
|
|
8
|
-
An unofficial CLI tool for creating, archiving, updating Stripe products and prices and syncing them to your database.
|
|
9
|
-
|
|
10
|
-
## Installation
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
npm install @makeco/stripe-kit
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## CLI Usage
|
|
17
|
-
|
|
18
|
-
### Core Commands
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
# Create subscription plans in Stripe
|
|
22
|
-
stripe-kit create -e dev -a postgres
|
|
23
|
-
|
|
24
|
-
# Archive subscription plans in Stripe
|
|
25
|
-
stripe-kit archive -e prod -a postgres
|
|
26
|
-
|
|
27
|
-
# Sync Stripe plans to database
|
|
28
|
-
stripe-kit db sync -e staging -a postgres
|
|
29
|
-
|
|
30
|
-
# Update existing Stripe plans
|
|
31
|
-
stripe-kit update -e prod -a postgres
|
|
32
|
-
|
|
33
|
-
# Database operations
|
|
34
|
-
stripe-kit db purge -e dev -a postgres
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Utility Commands
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
# Show Stripe dashboard URLs
|
|
41
|
-
stripe-kit urls # Interactive selection (shows both live & test URLs)
|
|
42
|
-
stripe-kit urls -a # Show all URLs with labels
|
|
43
|
-
|
|
44
|
-
# List Stripe products
|
|
45
|
-
stripe-kit list products -e dev --all
|
|
46
|
-
|
|
47
|
-
# List Stripe prices
|
|
48
|
-
stripe-kit list prices -e dev --all
|
|
49
|
-
|
|
50
|
-
# View current user preferences
|
|
51
|
-
stripe-kit config
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Global Options
|
|
55
|
-
|
|
56
|
-
- `-c, --config <path>` - Path to stripe.config.ts file (defaults to ./stripe.config.ts)
|
|
57
|
-
- `-e, --env <environment>` - Target environment (test, dev, staging, prod)
|
|
58
|
-
- `-a, --adapter <name>` - Database adapter name
|
|
3
|
+
> **⚠️ Experimental:** This tool is currently in experimental status and may undergo breaking changes.
|
|
59
4
|
|
|
60
|
-
|
|
5
|
+
A CLI tool for creating, archiving, updating Stripe products and prices and syncing them to your database.
|
|
61
6
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
# First time - you'll be prompted to select
|
|
66
|
-
stripe-kit create
|
|
67
|
-
|
|
68
|
-
# Subsequent runs - your last selection is pre-selected
|
|
69
|
-
stripe-kit archive # Uses your last environment/adapter as initial choice
|
|
70
|
-
|
|
71
|
-
# View current preferences
|
|
72
|
-
stripe-kit config
|
|
73
|
-
```
|
|
7
|
+
[](https://badge.fury.io/js/%40makeco%2Fstripe-kit)
|
|
8
|
+
[](https://www.typescriptlang.org/)
|
|
9
|
+
[](https://opensource.org/licenses/MIT)
|
|
74
10
|
|
|
75
|
-
|
|
11
|
+
**Key Features:**
|
|
76
12
|
|
|
77
|
-
|
|
13
|
+
- 🛒 **Product Management** - Create, update, and archive Stripe products and prices
|
|
14
|
+
- 🗄️ **Database Sync** - Sync Stripe data to your database with adapters
|
|
15
|
+
- 🌱 **Multi-Environment** - Built-in support for test, dev, staging, prod
|
|
16
|
+
- 📝 **TypeScript** - Full type safety with configuration files
|
|
17
|
+
- 🔧 **User Preferences** - Remembers your last used environment and adapter
|
|
78
18
|
|
|
79
|
-
|
|
19
|
+
**Quick Start:**
|
|
80
20
|
|
|
81
21
|
```bash
|
|
82
|
-
|
|
83
|
-
stripe-kit
|
|
84
|
-
|
|
85
|
-
# Purge database plans
|
|
86
|
-
stripe-kit db purge -e dev -a postgres
|
|
87
|
-
|
|
88
|
-
# Sync Stripe plans to database
|
|
89
|
-
stripe-kit db sync -e dev -a postgres
|
|
22
|
+
npm install @makeco/stripe-kit
|
|
23
|
+
yarn add @makeco/stripe-kit
|
|
24
|
+
bun add @makeco/stripe-kit
|
|
90
25
|
```
|
|
91
26
|
|
|
92
|
-
### List Operations
|
|
93
|
-
|
|
94
27
|
```bash
|
|
95
|
-
#
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
#
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
# List
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
// Use the configuration helper
|
|
111
|
-
export default defineConfig({
|
|
112
|
-
plans: [
|
|
113
|
-
{
|
|
114
|
-
product: {
|
|
115
|
-
id: 'basic-plan',
|
|
116
|
-
name: 'Basic Plan',
|
|
117
|
-
description: 'Our basic subscription plan'
|
|
118
|
-
},
|
|
119
|
-
prices: [
|
|
120
|
-
{
|
|
121
|
-
id: 'basic-monthly',
|
|
122
|
-
nickname: 'Basic Monthly',
|
|
123
|
-
unitAmount: 999,
|
|
124
|
-
currency: 'usd',
|
|
125
|
-
recurring: { interval: 'month' }
|
|
126
|
-
}
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
adapters: {
|
|
131
|
-
postgres: {
|
|
132
|
-
// Your database adapter configuration
|
|
133
|
-
connectionString: process.env.DATABASE_URL
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
});
|
|
28
|
+
# Commands
|
|
29
|
+
create # Create subscription plans in Stripe
|
|
30
|
+
archive # Archive subscription plans in Stripe
|
|
31
|
+
update # Update existing Stripe plans
|
|
32
|
+
db sync # Sync Stripe plans to database
|
|
33
|
+
db purge # Purge database plans
|
|
34
|
+
list products # List Stripe products
|
|
35
|
+
list prices # List Stripe prices
|
|
36
|
+
urls # Show Stripe dashboard URLs
|
|
37
|
+
config # View current user preferences
|
|
38
|
+
|
|
39
|
+
# Global Options
|
|
40
|
+
-c, --config <path> # Path to stripe.config.ts file (default: ./stripe.config.ts)
|
|
41
|
+
-e, --env <environment> # Target environment (test, dev, staging, prod)
|
|
42
|
+
-a, --adapter <name> # Database adapter name
|
|
137
43
|
```
|
|
138
44
|
|
|
139
45
|
## Configuration
|
|
@@ -141,61 +47,46 @@ export default defineConfig({
|
|
|
141
47
|
Create a `stripe.config.ts` file in your project root:
|
|
142
48
|
|
|
143
49
|
```typescript
|
|
144
|
-
import { defineConfig } from
|
|
50
|
+
import { defineConfig } from "stripe-kit";
|
|
145
51
|
|
|
146
52
|
export default defineConfig({
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
53
|
+
plans: [
|
|
54
|
+
{
|
|
55
|
+
// Stripe.Product (camelCase)
|
|
56
|
+
product: {
|
|
57
|
+
id: "pro-plan",
|
|
58
|
+
name: "Pro Plan",
|
|
59
|
+
description: "Professional features for growing teams",
|
|
60
|
+
},
|
|
61
|
+
// Stripe.Price[] (camelCase)
|
|
62
|
+
prices: [
|
|
63
|
+
{
|
|
64
|
+
id: "pro-monthly",
|
|
65
|
+
nickname: "Pro Monthly",
|
|
66
|
+
unitAmount: 2999,
|
|
67
|
+
currency: "usd",
|
|
68
|
+
recurring: { interval: "month" },
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "pro-yearly",
|
|
72
|
+
nickname: "Pro Yearly",
|
|
73
|
+
unitAmount: 29999,
|
|
74
|
+
currency: "usd",
|
|
75
|
+
recurring: { interval: "year" },
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
adapters: {
|
|
81
|
+
// Custom property key. Can be postgres, sqlite, turso, myAdapter, etc.
|
|
82
|
+
postgres: {
|
|
83
|
+
// Your PostgreSQL adapter configuration
|
|
84
|
+
connectionString: process.env.DATABASE_URL,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
182
87
|
});
|
|
183
88
|
```
|
|
184
89
|
|
|
185
|
-
##
|
|
186
|
-
|
|
187
|
-
Create environment files for different stages:
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
# .env.development
|
|
191
|
-
STRIPE_SECRET_KEY=sk_test_...
|
|
192
|
-
DATABASE_URL=postgresql://...
|
|
193
|
-
|
|
194
|
-
# .env.production
|
|
195
|
-
STRIPE_SECRET_KEY=sk_live_...
|
|
196
|
-
DATABASE_URL=postgresql://...
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
## Database Support
|
|
90
|
+
## License
|
|
200
91
|
|
|
201
|
-
|
|
92
|
+
MIT © [makeco](https://github.com/makeco-labs)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makeco/stripe-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"author": "makeco",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"build": "bun clean && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json --resolve-full-paths && chmod +x dist/cli.js",
|
|
51
51
|
"dev": "tsc -p tsconfig.build.json --watch",
|
|
52
52
|
"dev:typecheck": "bun typecheck --watch --preserveWatchOutput",
|
|
53
|
-
"lint": "
|
|
53
|
+
"lint": "bunx ultracite@latest lint",
|
|
54
54
|
"format": "bunx ultracite@latest format",
|
|
55
55
|
"test": "vitest",
|
|
56
56
|
"ci": "bun lint && bun typecheck && bun format && bun run build",
|