@liteguard/liteguard 0.2.20260314
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 +55 -0
- package/dist/browser.d.mts +3 -0
- package/dist/browser.d.ts +3 -0
- package/dist/browser.js +25 -0
- package/dist/browser.js.map +1 -0
- package/dist/browser.mjs +3 -0
- package/dist/browser.mjs.map +1 -0
- package/dist/index.browser.d.mts +1 -0
- package/dist/index.browser.d.ts +1 -0
- package/dist/index.browser.js +25 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.browser.mjs +3 -0
- package/dist/index.browser.mjs.map +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/dist/node.d.mts +1 -0
- package/dist/node.d.ts +1 -0
- package/dist/node.js +25 -0
- package/dist/node.js.map +1 -0
- package/dist/node.mjs +3 -0
- package/dist/node.mjs.map +1 -0
- package/dist/react.d.mts +1 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +25 -0
- package/dist/react.js.map +1 -0
- package/dist/react.mjs +3 -0
- package/dist/react.mjs.map +1 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# @liteguard/liteguard
|
|
2
|
+
|
|
3
|
+
[](https://github.com/liteguard/liteguard/actions/workflows/test-js.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@liteguard/liteguard)
|
|
5
|
+
|
|
6
|
+
Umbrella package for the Liteguard JavaScript SDK.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @liteguard/liteguard
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { LiteguardClient } from "@liteguard/liteguard";
|
|
18
|
+
|
|
19
|
+
const client = await LiteguardClient.create("pckid-...", {
|
|
20
|
+
environment: "production",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const scope = client.createScope({ userId: "user-123", plan: "pro" });
|
|
24
|
+
|
|
25
|
+
if (scope.isOpen("payments.checkout")) {
|
|
26
|
+
// ...
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
await client.shutdown();
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Packages
|
|
33
|
+
|
|
34
|
+
| Package | Use when |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `@liteguard/liteguard` | You want automatic runtime resolution |
|
|
37
|
+
| `@liteguard/liteguard-node` | Node.js servers, workers, CLIs |
|
|
38
|
+
| `@liteguard/liteguard-browser` | Browser applications |
|
|
39
|
+
| `@liteguard/liteguard-react` | React components and hooks |
|
|
40
|
+
|
|
41
|
+
## Primary API
|
|
42
|
+
|
|
43
|
+
This package exposes the same explicit-client API as the runtime-specific packages:
|
|
44
|
+
|
|
45
|
+
- `LiteguardClient.create()`
|
|
46
|
+
- `client.createScope()`
|
|
47
|
+
- `scope.isOpen()`
|
|
48
|
+
- `scope.executeIfOpen()` / `scope.executeIfOpenAsync()`
|
|
49
|
+
- `scope.withProperties()` / `scope.withProtectedContext()`
|
|
50
|
+
- `client.flush()`
|
|
51
|
+
- `client.shutdown()`
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
Apache 2.0 — see [LICENSE](https://github.com/liteguard/liteguard/blob/main/LICENSE).
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/browser.ts
|
|
18
|
+
var browser_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(browser_exports);
|
|
20
|
+
__reExport(browser_exports, require("@liteguard/liteguard-browser"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("@liteguard/liteguard-browser")
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/browser.ts"],"sourcesContent":["export * from '@liteguard/liteguard-browser';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4BAAc,yCAAd;","names":[]}
|
package/dist/browser.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/browser.ts"],"sourcesContent":["export * from '@liteguard/liteguard-browser';\n"],"mappings":";AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@liteguard/liteguard-browser';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@liteguard/liteguard-browser';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/index.browser.ts
|
|
18
|
+
var index_browser_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(index_browser_exports);
|
|
20
|
+
__reExport(index_browser_exports, require("@liteguard/liteguard-browser"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("@liteguard/liteguard-browser")
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=index.browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.browser.ts"],"sourcesContent":["export * from '@liteguard/liteguard-browser';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,kCAAc,yCAAd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.browser.ts"],"sourcesContent":["export * from '@liteguard/liteguard-browser';\n"],"mappings":";AAAA,cAAc;","names":[]}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@liteguard/liteguard-node';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@liteguard/liteguard-node';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/index.ts
|
|
18
|
+
var index_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(index_exports);
|
|
20
|
+
__reExport(index_exports, require("@liteguard/liteguard-node"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("@liteguard/liteguard-node")
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from '@liteguard/liteguard-node';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,sCAAd;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from '@liteguard/liteguard-node';\n"],"mappings":";AAAA,cAAc;","names":[]}
|
package/dist/node.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@liteguard/liteguard-node';
|
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@liteguard/liteguard-node';
|
package/dist/node.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/node.ts
|
|
18
|
+
var node_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(node_exports);
|
|
20
|
+
__reExport(node_exports, require("@liteguard/liteguard-node"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("@liteguard/liteguard-node")
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=node.js.map
|
package/dist/node.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/node.ts"],"sourcesContent":["export * from '@liteguard/liteguard-node';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,yBAAc,sCAAd;","names":[]}
|
package/dist/node.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/node.ts"],"sourcesContent":["export * from '@liteguard/liteguard-node';\n"],"mappings":";AAAA,cAAc;","names":[]}
|
package/dist/react.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@liteguard/liteguard-react';
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@liteguard/liteguard-react';
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/react.ts
|
|
18
|
+
var react_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(react_exports);
|
|
20
|
+
__reExport(react_exports, require("@liteguard/liteguard-react"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("@liteguard/liteguard-react")
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react.ts"],"sourcesContent":["export * from '@liteguard/liteguard-react';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,uCAAd;","names":[]}
|
package/dist/react.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react.ts"],"sourcesContent":["export * from '@liteguard/liteguard-react';\n"],"mappings":";AAAA,cAAc;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@liteguard/liteguard",
|
|
3
|
+
"version": "0.2.20260314",
|
|
4
|
+
"description": "Liteguard SDK — feature guards, observability, and security response in a single import. Resolves to the Node.js or browser runtime automatically.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"homepage": "https://liteguard.io",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/liteguard/liteguard.git",
|
|
13
|
+
"directory": "sdk/js/packages/liteguard"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"feature-flags",
|
|
17
|
+
"feature-guards",
|
|
18
|
+
"feature-toggles",
|
|
19
|
+
"liteguard",
|
|
20
|
+
"observability",
|
|
21
|
+
"security"
|
|
22
|
+
],
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"browser": "./dist/index.browser.mjs",
|
|
27
|
+
"import": "./dist/index.mjs",
|
|
28
|
+
"require": "./dist/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"sideEffects": false,
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsup src/index.ts src/index.browser.ts src/node.ts src/browser.ts src/react.ts --format cjs,esm --dts --sourcemap --clean"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@liteguard/liteguard-browser": "*",
|
|
41
|
+
"@liteguard/liteguard-node": "*",
|
|
42
|
+
"@liteguard/liteguard-react": "*"
|
|
43
|
+
}
|
|
44
|
+
}
|