After trying to contact the original node-apple-signin owner alaborderie about helping out maintaining the library, but didn't get back a response. As I saw that compared to other "apple sign in" libraries this one seemed to have the biggest community wanting to improve it. Multiple opened issues and pull-requests that are sitting opened for months.
As on npm there still isn't a go-to package for apple sign in, so taking matters in my own hands and forking library and implementing most changes from their PR and fixing issues. Trying to make it the go-to choice when you want to implement Apple Sign In.
Support for privateKeyPath is kept in the library, but it is moved to a new function createClientSecretFromPath()(see below). It was done so we keep the function functional without overloading its behaviour depending on props.
Added createClientSecretFromPath()
Similar to createClientSecret() but instead of a public key it takes in a path to it. Internally it synchronously (as before) reads the private key contents and calls createClientSecret().
❓ Like to see feedback on this, as I'm not yet 100% I want to separate the functions.
Added new optional expirationDuration option, which allows setting the clients secret expiration time, instead of using the max allowed 6 months. If not set, defaults back to 6 months.
Removed getApplePublicKey() in-favour of getApplePublicKeys()
Revive node-apple-sign
Revive development of node-apple-signin!
After trying to contact the original
node-apple-signin
owner alaborderie about helping out maintaining the library, but didn't get back a response. As I saw that compared to other "apple sign in" libraries this one seemed to have the biggest community wanting to improve it. Multiple opened issues and pull-requests that are sitting opened for months.As on npm there still isn't a go-to package for apple sign in, so taking matters in my own hands and forking library and implementing most changes from their PR and fixing issues. Trying to make it the go-to choice when you want to implement Apple Sign In.
^ Related
Changes
API
Changed
createClientSecret()
Now only takes in
privateKey
contents instead of a file path. Now you can use it to inject private key trough environmentals. Closes https://github.com/Techofficer/node-apple-signin/issues/4. https://github.com/Techofficer/node-apple-signin/pull/5Support for
privateKeyPath
is kept in the library, but it is moved to a new functioncreateClientSecretFromPath()
(see below). It was done so we keep the function functional without overloading its behaviour depending on props.Added
createClientSecretFromPath()
createClientSecret()
but instead of a public key it takes in a path to it. Internally it synchronously (as before) reads the private key contents and callscreateClientSecret()
.expirationDuration
option, which allows setting the clients secret expiration time, instead of using the max allowed 6 months. If not set, defaults back to 6 months.Removed
getApplePublicKey()
in-favour ofgetApplePublicKeys()
Added
getApplePublicKeys()
Changed
getAuthorizationToken()
:options.redirectUri
optional. Closes https://github.com/Techofficer/node-apple-signin/pull/12, https://github.com/Techofficer/node-apple-signin/pull/7:bug: Fix
getAuthorizationUrl()
:email
if didn't limitedopenId
scope, as I found no official documentation or their browser js library using that scopeMisc:
clientID
toclientId
to keep in consistent withteamId
,clientSecret
Internal
request-promise-native
foraxios
Improved Developer experience
Source code now fully typed using typescript with support for Node.js >= 10 (a.k.a ES2018)
Comes bundled with typescript types
📕Auto-generated docs using
typedoc
! Still needs work on documenting functions/interfaces to become more user friendly, so PR's welcomed!Improved formating by migrating from
eslint-config-airbnb-base
tostandard
+prettier
🔧Layed down the groundwork for unit tests using
ts-jest
TO-DO
@renarsvilnis/node-apple-signin
.redirectUri
optional - https://github.com/Techofficer/node-apple-signin/pull/12, https://github.com/Techofficer/node-apple-signin/issues/6, https://github.com/Techofficer/node-apple-signin/pull/7