@opensecret/react 0.3.3 → 0.3.5

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
@@ -2,6 +2,8 @@
2
2
 
3
3
  This is a React SDK for the [OpenSecret](https://opensecret.cloud) platform.
4
4
 
5
+ 🚧 We're currently in preview mode, please contact us at team@opensecret.cloud for the preview URL and getting started info 🚧
6
+
5
7
  ## Installation
6
8
 
7
9
  ```bash
@@ -17,7 +19,7 @@ import { OpenSecretProvider } from "@opensecret/react";
17
19
 
18
20
  function App() {
19
21
  return (
20
- <OpenSecretProvider apiUrl="https://preview-enclave.opensecret.cloud">
22
+ <OpenSecretProvider apiUrl="{URL}">
21
23
  <App />
22
24
  </OpenSecretProvider>
23
25
  );
@@ -53,7 +55,7 @@ function App() {
53
55
  The `OpenSecretProvider` component is the main entry point for the SDK. It requires a single prop, `apiUrl`, which should be set to the URL of your OpenSecret backend.
54
56
 
55
57
  ```tsx
56
- <OpenSecretProvider apiUrl="https://preview-enclave.opensecret.cloud">
58
+ <OpenSecretProvider apiUrl="{URL}">
57
59
  <App />
58
60
  </OpenSecretProvider>
59
61
  ```
@@ -171,6 +173,12 @@ To build the library, run the following command:
171
173
  bun run build
172
174
  ```
173
175
 
176
+ To test the library, run the following command:
177
+
178
+ ```bash
179
+ bun test --env-file .env.local
180
+ ```
181
+
174
182
  Currently this build step requires `npx` because of [a Bun incompatibility with `vite-plugin-dts`](https://github.com/OpenSecretCloud/OpenSecret-SDK/issues/16).
175
183
 
176
184
  To pack the library (for publishing) run the following command:
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import { z } from 'zod';
5
5
  declare namespace api {
6
6
  export {
7
7
  setApiUrl,
8
+ getApiUrl,
8
9
  fetchLogin,
9
10
  fetchGuestLogin,
10
11
  fetchSignUp,
@@ -158,7 +159,9 @@ export declare function generateSecureSecret(): string;
158
159
 
159
160
  declare function generateThirdPartyToken(audience: string): Promise<ThirdPartyTokenResponse>;
160
161
 
161
- declare function getAttestation(forceRefresh?: boolean): Promise<Attestation>;
162
+ declare function getApiUrl(): string;
163
+
164
+ declare function getAttestation(forceRefresh?: boolean, apiUrl?: string): Promise<Attestation>;
162
165
 
163
166
  export declare type GithubAuthResponse = {
164
167
  auth_url: string;