# node-mac-sign-in-with-apple

> A native module that allows you to Sign in with Apple in macOS

Latest version **0.5.0** (published 2021-06-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-mac-sign-in-with-apple
pnpm add node-mac-sign-in-with-apple
yarn add node-mac-sign-in-with-apple
bun add node-mac-sign-in-with-apple
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2021-06-09 |
| First published | 2020-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 10 |
| Maintainers | jpalumickas, nedomas, saimis |
| Keywords | apple, login, sign-in, macos, node, electron, native |

## Links

- npm: https://www.npmjs.com/package/node-mac-sign-in-with-apple
- Repository: https://github.com/vietaapp/node-mac-sign-in-with-apple
- Homepage: https://github.com/vietaapp/node-mac-sign-in-with-apple#readme
- Issues: https://github.com/vietaapp/node-mac-sign-in-with-apple/issues
- npm.io page: https://npm.io/package/node-mac-sign-in-with-apple

## Dependencies (2)

- [bindings](https://npm.io/package/bindings.md) ^1.5.0
- [node-addon-api](https://npm.io/package/node-addon-api.md) ^3.0.2

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.5.0 (latest) — 2021-06-09
- 0.4.0 — 2020-11-12
- 0.3.0 — 2020-10-06

## README

# node macOS Sign in With Apple

## Installation

Using Yarn
```sh
yarn add node-mac-sign-in-with-apple
```

Using NPM

```sh
npm install node-mac-sign-in-with-apple
```

## Usage with Electron

Add to main process

```js
import { signInWithApple } from 'node-mac-sign-in-with-apple';

ipcMain.on('sign-in-with-apple', async () => {
  const nativeWindow = mainWindow.getNativeWindowHandle();

  try {
    const data = await signInWithApple(nativeWindow);
    // {
    //   idToken: 'TOKEN',
    //   code: 'CODE',
    //   firstName: 'John',
    //   middleName: 'Chris',
    //   lastName: 'Doe',
    //   email: 'john.doe@example.com'
    // }
  } catch(err) {
    // { code: 1000, message: 'Error message' }
  }
})
```

> **Note:** Only on first login Apple returns email and user name, on other requests
> Apple returns only **idToken**


Add to entitlements.plist

```xml
<key>com.apple.developer.applesignin</key>
<array>
  <string>Default</string>
</array>
```
## Thanks

Big thanks to [**@dynbit**](https://github.com/dynbit) for his help and contribution!

## License

The package is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

---
_Source: https://npm.io/package/node-mac-sign-in-with-apple · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
