@signedby/sdk 0.1.0 → 1.0.0

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 CHANGED
@@ -1,101 +1,76 @@
1
- # SignedByMe TypeScript SDK
1
+ # SIGNEDBYME TypeScript SDK
2
2
 
3
- Human-controlled identity for autonomous agents.
3
+ Self-signing digital signatures with zero-knowledge proofs.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
8
  npm install @signedby/sdk
9
+ # or
10
+ yarn add @signedby/sdk
9
11
  ```
10
12
 
11
13
  ## Quick Start
12
14
 
13
- ### For Agents - Authenticate to Enterprises
14
-
15
15
  ```typescript
16
- import { SignedByClient } from '@signedby/sdk';
17
-
18
- // Load delegation from your human owner
19
- const client = await SignedByClient.fromDelegation('./delegation.json');
20
-
21
- console.log(`Your npub: ${client.npub}`);
22
- console.log(`Authorized for: ${JSON.stringify(client.scopes)}`);
16
+ import { SignedByAgent, SignedByClient } from '@signedby/sdk';
23
17
 
24
- // Authenticate to an enterprise
25
- const token = await client.login({
26
- clientId: 'acme-corp',
27
- nonce: 'random_nonce_here'
18
+ // Initialize agent
19
+ const agent = await SignedByAgent.init({
20
+ storagePath: './agent_data'
28
21
  });
29
22
 
30
- // Use the OIDC token
31
- console.log(`ID Token: ${token.idToken}`);
32
- console.log(`Subject: ${token.sub}`);
33
- ```
34
-
35
- ### For Agent Setup - Initialize Identity
36
-
37
- ```typescript
38
- import { SignedByAgent } from '@signedby/sdk';
39
-
40
- // Initialize agent (creates DID if first run)
41
- const agent = await SignedByAgent.init('./agent_data');
42
-
43
- console.log(`Agent npub: ${agent.npub}`);
44
-
45
- // Configure email mapping for enterprises
23
+ // Set email mapping for enterprises
46
24
  agent.setEmailMapping({
47
- 'amazon.com': 'you@gmail.com',
48
- 'acme.com': 'you@gmail.com'
25
+ 'example.com': 'user@example.com'
49
26
  });
50
27
 
51
- // Connect to relay and watch for authorizations
52
- await agent.connectRelay('wss://relay.privacy-lion.com');
28
+ // Connect to SIGNEDBYME relays
29
+ await agent.connectRelays();
53
30
 
54
- for await (const event of agent.watchForAuthorizations()) {
55
- console.log(`New authorization from: ${event.enterprise}`);
56
- console.log(`Scopes: ${event.scopes}`);
31
+ // Watch for authorization requests
32
+ for await (const authRequest of agent.watchForAuthorizations()) {
33
+ console.log(`Authorization from ${authRequest.enterprise}`);
57
34
  }
35
+
36
+ // Authenticate
37
+ const client = new SignedByClient('https://api.signedbyme.com');
38
+ const token = await client.authenticate({
39
+ clientId: 'example',
40
+ proof: await agent.generateProof()
41
+ });
42
+ console.log(`Authenticated: ${token.sub}`);
58
43
  ```
59
44
 
60
- ## Error Handling
45
+ ## Features
61
46
 
62
- ```typescript
63
- import {
64
- SignedByClient,
65
- SignedByError,
66
- DelegationRevokedError,
67
- DelegationExpiredError,
68
- ScopeDeniedError,
69
- } from '@signedby/sdk';
70
-
71
- try {
72
- const token = await client.login({ clientId: 'acme-corp', nonce });
73
- } catch (error) {
74
- if (error instanceof DelegationRevokedError) {
75
- console.log('Delegation was revoked. Contact your human owner.');
76
- } else if (error instanceof DelegationExpiredError) {
77
- console.log('Delegation expired. Request renewal from your human owner.');
78
- } else if (error instanceof ScopeDeniedError) {
79
- console.log('Not authorized for this enterprise.');
80
- } else if (error instanceof SignedByError) {
81
- console.log(`Authentication failed: ${error.message}`);
82
- }
83
- }
84
- ```
47
+ - **Agent Management**: DID generation, secure storage
48
+ - **Groth16 ZK Proofs**: Native Rust core via napi-rs
49
+ - **NOSTR Integration**: Automatic relay management
50
+ - **OIDC Compatible**: Standard JWT id_tokens
85
51
 
86
52
  ## Requirements
87
53
 
88
54
  - Node.js 18+
89
- - Supported platforms: Linux (x86_64, arm64), macOS (x86_64, arm64), Windows (x86_64)
55
+ - Platform-specific native bindings (included)
56
+
57
+ ## Supported Platforms
58
+
59
+ - Linux x64 (glibc)
60
+ - Linux ARM64 (glibc)
61
+ - macOS x64 (Intel)
62
+ - macOS ARM64 (Apple Silicon)
63
+ - Windows x64
90
64
 
91
65
  ## Documentation
92
66
 
93
- - [SDK Quick Start](https://signedbyme.com/docs/sdk-quickstart.html)
94
- - [API Reference](https://signedbyme.com/docs/api-reference.html)
95
- - [Understanding Delegation](https://signedbyme.com/docs/delegation.html)
67
+ Full documentation: [https://docs.signedbyme.com](https://docs.signedbyme.com)
96
68
 
97
69
  ## License
98
70
 
99
- SignedByMe Source-Available License v1.0 (SSAL-1.0)
71
+ SSAL-1.0 (SignedByMe Source-Available License)
72
+
73
+ ## Links
100
74
 
101
- See [LICENSE](https://github.com/PrivacyLion/SignedByMe/blob/main/LICENSE) for details.
75
+ - [GitHub](https://github.com/SIGNEDBYME-APP/SIGNEDBYME)
76
+ - [Website](https://signedbyme.com)
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Type definitions for SignedByMe SDK.
2
+ * Type definitions for SIGNEDBYME SDK.
3
3
  */
4
4
  /**
5
5
  * OIDC token returned from successful authentication.
@@ -48,7 +48,7 @@ interface AuthorizationEvent {
48
48
  interface LoginOptions {
49
49
  /** NOSTR relay URL (default: wss://relay.privacy-lion.com) */
50
50
  relayUrl?: string;
51
- /** SignedByMe API URL (default: https://api.beta.privacy-lion.com) */
51
+ /** SIGNEDBYME API URL (default: https://api.beta.privacy-lion.com) */
52
52
  apiUrl?: string;
53
53
  }
54
54
 
@@ -57,7 +57,7 @@ interface LoginOptions {
57
57
  */
58
58
 
59
59
  /**
60
- * Client for authenticating to enterprises using SignedByMe.
60
+ * Client for authenticating to enterprises using SIGNEDBYME.
61
61
  *
62
62
  * @example
63
63
  * ```typescript
@@ -171,10 +171,10 @@ declare class SignedByAgent {
171
171
  }
172
172
 
173
173
  /**
174
- * SignedByMe SDK Errors.
174
+ * SIGNEDBYME SDK Errors.
175
175
  */
176
176
  /**
177
- * Base error class for all SignedByMe errors.
177
+ * Base error class for all SIGNEDBYME errors.
178
178
  */
179
179
  declare class SignedByError extends Error {
180
180
  constructor(message: string);
@@ -231,7 +231,7 @@ declare class RelayConnectionError extends SignedByError {
231
231
  constructor(message?: string);
232
232
  }
233
233
  /**
234
- * Raised when the SignedByMe API returns an error.
234
+ * Raised when the SIGNEDBYME API returns an error.
235
235
  */
236
236
  declare class ApiError extends SignedByError {
237
237
  readonly errorCode?: string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Type definitions for SignedByMe SDK.
2
+ * Type definitions for SIGNEDBYME SDK.
3
3
  */
4
4
  /**
5
5
  * OIDC token returned from successful authentication.
@@ -48,7 +48,7 @@ interface AuthorizationEvent {
48
48
  interface LoginOptions {
49
49
  /** NOSTR relay URL (default: wss://relay.privacy-lion.com) */
50
50
  relayUrl?: string;
51
- /** SignedByMe API URL (default: https://api.beta.privacy-lion.com) */
51
+ /** SIGNEDBYME API URL (default: https://api.beta.privacy-lion.com) */
52
52
  apiUrl?: string;
53
53
  }
54
54
 
@@ -57,7 +57,7 @@ interface LoginOptions {
57
57
  */
58
58
 
59
59
  /**
60
- * Client for authenticating to enterprises using SignedByMe.
60
+ * Client for authenticating to enterprises using SIGNEDBYME.
61
61
  *
62
62
  * @example
63
63
  * ```typescript
@@ -171,10 +171,10 @@ declare class SignedByAgent {
171
171
  }
172
172
 
173
173
  /**
174
- * SignedByMe SDK Errors.
174
+ * SIGNEDBYME SDK Errors.
175
175
  */
176
176
  /**
177
- * Base error class for all SignedByMe errors.
177
+ * Base error class for all SIGNEDBYME errors.
178
178
  */
179
179
  declare class SignedByError extends Error {
180
180
  constructor(message: string);
@@ -231,7 +231,7 @@ declare class RelayConnectionError extends SignedByError {
231
231
  constructor(message?: string);
232
232
  }
233
233
  /**
234
- * Raised when the SignedByMe API returns an error.
234
+ * Raised when the SIGNEDBYME API returns an error.
235
235
  */
236
236
  declare class ApiError extends SignedByError {
237
237
  readonly errorCode?: string;
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ var require_native = __commonJS({
46
46
  const packageName = platformMap[platformName]?.[archName];
47
47
  if (!packageName) {
48
48
  throw new Error(
49
- `Unsupported platform: ${platformName}-${archName}. SignedByMe SDK supports: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64`
49
+ `Unsupported platform: ${platformName}-${archName}. SIGNEDBYME SDK supports: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64`
50
50
  );
51
51
  }
52
52
  try {
package/dist/index.mjs CHANGED
@@ -35,7 +35,7 @@ var require_native = __commonJS({
35
35
  const packageName = platformMap[platformName]?.[archName];
36
36
  if (!packageName) {
37
37
  throw new Error(
38
- `Unsupported platform: ${platformName}-${archName}. SignedByMe SDK supports: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64`
38
+ `Unsupported platform: ${platformName}-${archName}. SIGNEDBYME SDK supports: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64`
39
39
  );
40
40
  }
41
41
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@signedby/sdk",
3
- "version": "0.1.0",
4
- "description": "SignedByMe SDK - Human-controlled identity for autonomous agents",
3
+ "version": "1.0.0",
4
+ "description": "SIGNEDBYME SDK - Human-controlled identity for autonomous agents",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
@@ -34,32 +34,32 @@
34
34
  "oidc",
35
35
  "did"
36
36
  ],
37
- "author": "Privacy Lion <contact@privacy-lion.com>",
37
+ "author": "SIGNEDBYME <contact@signedbyme.com>",
38
38
  "license": "SSAL-1.0",
39
39
  "repository": {
40
40
  "type": "git",
41
- "url": "https://github.com/PrivacyLion/SignedByMe.git",
41
+ "url": "https://github.com/SIGNEDBYME-APP/SIGNEDBYME.git",
42
42
  "directory": "sdk/typescript"
43
43
  },
44
44
  "homepage": "https://signedbyme.com",
45
45
  "bugs": {
46
- "url": "https://github.com/PrivacyLion/SignedByMe/issues"
46
+ "url": "https://github.com/SIGNEDBYME-APP/SIGNEDBYME/issues"
47
47
  },
48
48
  "engines": {
49
49
  "node": ">=18.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@types/node": "^20.0.0",
53
- "tsup": "^8.0.0",
54
- "typescript": "^5.0.0",
55
- "vitest": "^1.0.0",
56
- "eslint": "^8.0.0",
57
- "@typescript-eslint/eslint-plugin": "^6.0.0",
58
- "@typescript-eslint/parser": "^6.0.0"
52
+ "@types/node": "^22.0.0",
53
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
54
+ "@typescript-eslint/parser": "^8.0.0",
55
+ "eslint": "^9.0.0",
56
+ "tsup": "^8.2.0",
57
+ "typescript": "^5.5.0",
58
+ "vitest": "^2.0.0"
59
59
  },
60
60
  "dependencies": {
61
- "@noble/curves": "^1.3.0",
62
- "@noble/hashes": "^1.3.0"
61
+ "@noble/curves": "^1.6.0",
62
+ "@noble/hashes": "^1.5.0"
63
63
  },
64
64
  "optionalDependencies": {
65
65
  "@signedby/core-linux-x64-gnu": "0.1.0",