Practic Passkey - v1.0.0
    Preparing search index...

    Function createDevice

    • A device with one passkey: a P-256 key in WebCrypto that answers registration and sign-in the way a platform authenticator does, so the server verifies genuine signatures with the library's own checks.

      Parameters

      • signOrigin: string = origin

        Origin the device's browser reports, http://localhost:3000 unless given.

      Returns Promise<
          { counter: number; id: string; userId: string } & {
              register: (
                  options: {
                      challenge: string;
                      excludeCredentials: CredentialDescriptor[];
                      outcome: "signed-up" | "passkey-added";
                      user: { displayName: string; id: string; name: string };
                  },
              ) => RegistrationJSON;
              sign: (challenge: string) => Promise<AuthenticationResponseJSON>;
          },
      >