@diadal/signin-with-apple
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

@diadal/signin-with-apple

Sign In With Apple for Capacitor 3

Install

npm install @diadal/signin-with-apple
npx cap sync
<template>
  <div class="row items-center justify-evenly">
    <button label="Test" @click="LoginApp()" />
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { uid } from 'quasar';
import {
  SigninWithApple,
  AppleSignResponse,
  AppleSignOptions,
} from '@diadal/signin-with-apple';

export default defineComponent({
  name: 'PageIndex',
  setup() {
    const options: AppleSignOptions = {
      clientId: 'app.example',
      redirectURI: 'https://example.com/auth/apple/callback',
      scopes: 'email name',
      state: '********',
      nonce: '**********',
    };

    function LoginApp() {
      SigninWithApple.authorize(options)
        .then((result: AppleSignResponse) => {
          console.log('result111', result);
        })
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        .catch((error: any) => {
          console.log('error111', error);
        });
    }

    return { LoginApp };
  },
});
</script>

API

authorize(...)

authorize(options?: AppleSignOptions | undefined) => Promise<AppleSignResponse>
Param Type
options AppleSignOptions

Returns: Promise<AppleSignResponse>


Interfaces

AppleSignResponse

Prop Type
response { user: string[]; email: string | null; state: string | null; id_token: string; code: string; }

AppleSignOptions

Prop Type
clientId string
redirectURI string
scopes string
state string
nonce string

Readme

Keywords

Package Sidebar

Install

npm i @diadal/signin-with-apple

Weekly Downloads

2

Version

0.1.6

License

MIT

Unpacked Size

47.6 kB

Total Files

30

Last publish

Collaborators

  • diadal