Skip to content

Commit e0b2b07

Browse files
committed
fix: add rollup.config.js and API Endpoints section to README
1 parent 6fa0a84 commit e0b2b07

2 files changed

Lines changed: 114 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,31 @@ client.setWebhookHandler((event, data) => {
165165
await client.startWebhookListener();
166166
```
167167

168+
## 📚 API Endpoints
169+
170+
All endpoints automatically use the `/v1` prefix when connecting to `https://api.licensechain.app`.
171+
172+
### Base URL
173+
- **Production**: `https://api.licensechain.app/v1`
174+
- **Development**: `https://api.licensechain.app/v1`
175+
176+
### Available Endpoints
177+
178+
| Method | Endpoint | Description |
179+
|--------|----------|-------------|
180+
| `GET` | `/v1/health` | Health check |
181+
| `POST` | `/v1/auth/login` | User login |
182+
| `POST` | `/v1/auth/register` | User registration |
183+
| `GET` | `/v1/apps` | List applications |
184+
| `POST` | `/v1/apps` | Create application |
185+
| `GET` | `/v1/licenses` | List licenses |
186+
| `POST` | `/v1/licenses/verify` | Verify license |
187+
| `GET` | `/v1/webhooks` | List webhooks |
188+
| `POST` | `/v1/webhooks` | Create webhook |
189+
| `GET` | `/v1/analytics` | Get analytics |
190+
191+
**Note**: The SDK automatically prepends `/v1` to all endpoints, so you only need to specify the path (e.g., `/auth/login` instead of `/v1/auth/login`).
192+
168193
## 📚 API Reference
169194

170195
### LicenseChain Client

rollup.config.js

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import { babel } from '@rollup/plugin-babel';
2+
import commonjs from '@rollup/plugin-commonjs';
3+
import { nodeResolve } from '@rollup/plugin-node-resolve';
4+
import terser from '@rollup/plugin-terser';
5+
import typescript from 'rollup-plugin-typescript2';
6+
import dts from 'rollup-plugin-dts';
7+
8+
const packageJson = require('./package.json');
9+
10+
const baseConfig = {
11+
input: 'src/index.js',
12+
external: ['axios', 'crypto-js'],
13+
plugins: [
14+
nodeResolve({
15+
preferBuiltins: false,
16+
}),
17+
commonjs(),
18+
babel({
19+
babelHelpers: 'bundled',
20+
exclude: 'node_modules/**',
21+
presets: [['@babel/preset-env', { targets: { node: '14' } }]],
22+
}),
23+
],
24+
};
25+
26+
export default [
27+
// CommonJS build
28+
{
29+
...baseConfig,
30+
output: {
31+
file: packageJson.main,
32+
format: 'cjs',
33+
exports: 'named',
34+
sourcemap: true,
35+
},
36+
plugins: [
37+
...baseConfig.plugins,
38+
typescript({
39+
tsconfig: 'tsconfig.json',
40+
useTsconfigDeclarationDir: true,
41+
}),
42+
],
43+
},
44+
// ES Module build
45+
{
46+
...baseConfig,
47+
output: {
48+
file: packageJson.module,
49+
format: 'es',
50+
sourcemap: true,
51+
},
52+
plugins: [
53+
...baseConfig.plugins,
54+
typescript({
55+
tsconfig: 'tsconfig.json',
56+
useTsconfigDeclarationDir: true,
57+
}),
58+
],
59+
},
60+
// UMD build (minified)
61+
{
62+
...baseConfig,
63+
output: {
64+
file: 'dist/index.umd.js',
65+
format: 'umd',
66+
name: 'LicenseChain',
67+
sourcemap: true,
68+
},
69+
plugins: [
70+
...baseConfig.plugins,
71+
typescript({
72+
tsconfig: 'tsconfig.json',
73+
useTsconfigDeclarationDir: true,
74+
}),
75+
terser(),
76+
],
77+
},
78+
// TypeScript definitions
79+
{
80+
input: 'src/index.ts',
81+
output: {
82+
file: packageJson.types,
83+
format: 'es',
84+
},
85+
plugins: [dts()],
86+
external: [/\.css$/],
87+
},
88+
];
89+

0 commit comments

Comments
 (0)