Skip to content

Commit

Permalink
feedback and changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkmin committed Dec 5, 2023
1 parent 1b49093 commit c98c222
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 33 deletions.
6 changes: 6 additions & 0 deletions .changeset/quick-buttons-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@turnkey/iframe-stamper": minor
---

- Add support for auth (e.g. via email), and include recovery under it. Note that this is a **breaking change**, as we are now using `injectCredentialBundle` as opposed to `injectRecoveryBundle`
- Update protos
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

## Did you add a changeset?

To add a changeset for your pr run [`pnpm changeset`](https://pnpm.io/using-changesets#adding-new-changesets). `pnpm changest` will generate a file where you should write a human friendly message about the changes. Note how this ([example](https://github.com/tkhq/sdk/blob/b409cd06790f011bf939adcf0755499b8e7497ae/.changeset/extra-http-exports.md?plain=1#L1)) includes the package name (should be auto added by the command) along with the type of [semver change (major.minor.patch)](https://semver.org/) (which you should set).
If updating one of our packages, you'll likely need to add a changeset to your PR. To do so, run [`pnpm changeset`](https://pnpm.io/using-changesets#adding-new-changesets). `pnpm changeset` will generate a file where you should write a human friendly message about the changes. Note how this ([example](https://github.com/tkhq/sdk/blob/b409cd06790f011bf939adcf0755499b8e7497ae/.changeset/extra-http-exports.md?plain=1#L1)) includes the package name (should be auto added by the command) along with the type of [semver change (major.minor.patch)](https://semver.org/) (which you should set).

These changes will be used at release time to determine what packages to publish and how to bump their version. For more context see [this comment](https://github.com/tkhq/sdk/pull/67#issuecomment-1568838440).
2 changes: 0 additions & 2 deletions examples/email-auth/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@ export default function AuthPage() {
});

const wallet = refineNonNull(completedActivity.result.createWalletResult);
const walletId = refineNonNull(wallet.walletId);
const address = refineNonNull(wallet.addresses[0]);

// Instead of simply alerting, redirect the user to your app's login page.
alert(`SUCCESS! Wallet and new address created: ${address} `);
};

Expand Down
32 changes: 2 additions & 30 deletions packages/iframe-stamper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This package contains functions to stamp a Turnkey request through credentials c

Usage:

Recovery
Recovery and Auth

```ts
import { IframeStamper } from "@turnkey/iframe-stamper";
Expand All @@ -25,7 +25,7 @@ const iframeStamper = new IframeStamper({
const publicKey = await iframeStamper.init();

// Injects a new credential in the iframe
const injected = await iframeStamper.injectCredentialBundle(recoveryBundle);
const injected = await iframeStamper.injectCredentialBundle(credentialBundle);

// New HTTP client able to sign with the credentials inside of the iframe
const httpClient = new TurnkeyClient(
Expand Down Expand Up @@ -55,31 +55,3 @@ const publicKey = await iframeStamper.init();
// Injects a new private key in the iframe
const injected = await iframeStamper.injectKeyExportBundle(exportBundle);
```

Auth

```ts
import { IframeStamper } from "@turnkey/iframe-stamper";
import { TurnkeyClient } from "@turnkey/http";

const TurnkeyIframeContainerId = "turnkey-iframe-container";
const TurnkeyIframeElementId = "turnkey-iframe";

const iframeStamper = new IframeStamper({
iframeUrl: process.env.IFRAME_URL!,
iframeContainerId: TurnkeyIframeContainerId,
iframeElementId: TurnkeyIframeElementId,
});

// This inserts the iframe in the DOM and returns the public key
const publicKey = await iframeStamper.init();

// Injects a new credential in the iframe
const injected = await iframeStamper.injectCredentialBundle(authBundle);

// New HTTP client able to sign with the credentials inside of the iframe
const httpClient = new TurnkeyClient(
{ baseUrl: "https://api.turnkey.com" },
iframeStamper
);
```

0 comments on commit c98c222

Please sign in to comment.