npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nixjs23n6/next-apple-login

v1.0.0

Published

Apple signin for React using the official Apple JS SDK and Nextjs.

Downloads

798

Readme

@nixjs23n6/next-apple-login

Apple signin for React using the official Apple JS SDK and Nextjs

Quick Setup

Install

Install these dependencies:

yarn add @nixjs23n6/next-apple-login

Setup & Usage

import React from 'react'
import getConfig from 'next/config'
import { ButtonApple, AppleResponse } from '@nixjs23n6/next-apple-login'

const { publicRuntimeConfig } = getConfig()

interface LoginPropArg {}

export const Login: React.FC<LoginPropArg> = () => {
    const responseApple = (response: AppleResponse) => {
        console.log(response, response.authorization?.id_token)
    }

    return (
        <ButtonApple
            // The developer’s client identifier, as provided by WWDR.
            clientId={publicRuntimeConfig.NEXT_PUBLIC_APPLE_CLIENT_ID}
            // The URI to which the authorization redirects.
            redirectURI={publicRuntimeConfig.NEXT_PUBLIC_REDIRECT}
            // The type of response requested. Valid values are code and id_token. You can request one or both. When requesting an id_token response type, response_mode must be either fragment or form_post.
            responseType="id_token"
            // The type of response mode expected. Valid values are query, fragment, and form_post. If you requested any scopes, the value must be form_post.
            responseMode="query"
            callback={responseApple}
        >
            <svg className="svg-view">
                <symbol id="svg-apple" viewBox="0 0 21 24" preserveAspectRatio="xMinYMin meet">
                    <path d="M19.3201 17.0726C19.1929 17.441 19.0597 17.7926 18.9181 18.1298C18.5725 18.9266 18.1645 19.6598 17.6917 20.333C17.0485 21.2522 16.5205 21.8882 16.1137 22.241C15.4837 22.8206 14.8081 23.1182 14.0845 23.1338C13.5649 23.1338 12.9397 22.9862 12.2101 22.6874C11.4793 22.3886 10.8073 22.241 10.1929 22.241C9.54852 22.241 8.85732 22.3886 8.11812 22.6874C7.37772 22.9862 6.78132 23.1434 6.32532 23.1578C5.63172 23.1878 4.94052 22.883 4.25052 22.241C3.81012 21.857 3.25932 21.1982 2.59932 20.2658C1.89132 19.2698 1.30932 18.1142 0.853317 16.7966C0.364917 15.3746 0.120117 13.997 0.120117 12.6638C0.120117 11.1362 0.450117 9.81861 1.11132 8.71461C1.63092 7.82781 2.32212 7.12821 3.18732 6.61461C4.05252 6.10101 4.98732 5.83941 5.99412 5.82261C6.54492 5.82261 7.26732 5.99301 8.16492 6.32781C9.06012 6.66381 9.63492 6.83421 9.88692 6.83421C10.0753 6.83421 10.7137 6.63501 11.7961 6.23781C12.8197 5.86941 13.6837 5.71701 14.3917 5.77701C16.3093 5.93181 17.7493 6.68781 18.7081 8.04981C16.9933 9.08901 16.1449 10.5446 16.1617 12.4118C16.1773 13.8662 16.7041 15.077 17.7409 16.0382C18.2113 16.4834 18.7369 16.8278 19.3201 17.0726ZM14.4961 0.366211C14.5117 0.518611 14.5189 0.671011 14.5189 0.822211C14.5189 1.96221 14.1025 3.02661 13.2733 4.01181C12.2713 5.18301 11.0593 5.85981 9.74532 5.75301C9.72852 5.61621 9.71892 5.47221 9.71892 5.32101C9.71892 4.22661 10.1953 3.05541 11.0413 2.09781C11.4637 1.61301 12.0013 1.20981 12.6517 0.88821C13.3021 0.57141 13.9177 0.396211 14.4961 0.366211Z" />
                </symbol>
            </svg>
        </ButtonApple>
    )
}