Skip to content

Commit

Permalink
temporarily expose local web5-user-agent through `web5.techPreview.us…
Browse files Browse the repository at this point in the history
…erAgent`
  • Loading branch information
mistermoe committed Jul 12, 2023
1 parent 2854581 commit c8895d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/web5/src/web5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class Web5 {
dwn: DwnApi;
vc: VcApi;
#connectedDid: string;
#techPreview: { userAgent: Web5UserAgent };

/**
* Statically available DID functionality. can be used to create and resolve DIDs without calling {@link connect}.
Expand All @@ -67,13 +68,19 @@ export class Web5 {
*/
get did() { return Web5.did; }

get techPreview() { return this.#techPreview; }

private static APP_DID_KEY = 'WEB5_APP_DID';

private constructor(options: Web5Options) {
this.#connectedDid = options.connectedDid;
this.dwn = new DwnApi(options.web5Agent, this.#connectedDid);
this.vc = new VcApi(options.web5Agent, this.#connectedDid);
this.appStorage ||= new AppStorage();

this.#techPreview = {
userAgent: options.web5Agent
};
}

/**
Expand Down

0 comments on commit c8895d7

Please sign in to comment.