Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

capacitor-cloudkit

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capacitor-cloudkit

Basic CloudKit authentication plugin.

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

capacitor-cloudkit

Basic CloudKit authentication plugin. v1 is Capacitor 4, v2 is Capacitor 5, v3 is Capacitor 6.

Install

npm install capacitor-cloudkit
npx cap sync

Setup

Each different platform requires a different ckAPIToken.

  • Web: Token configured for postMessage.
  • iOS: Token configured to redirect to your container's URL scheme. It'll show up on the CloudKit dashboard in a dropdown when you create an API key. Mine is cloudkit-icloud.baseline.getbaseline.app://, so I'll be using that as an example. I set mine to cloudkit-icloud.baseline.getbaseline.app://callback.
  • Android: Token configured to redirect to https://example.com or some similar existant but blank domain.

Setup (iOS)

  • Add your callback URL as a URL scheme in your app, in the Info tab. (e.g. cloudkit-icloud.baseline.getbaseline.app)
  • Add the following to the beginning of func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool in AppDelegate:
if (url.scheme == "PUT CALLBACK URL SCHEME HERE (e.g. cloudkit-icloud.baseline.getbaseline.app)") {
    NotificationCenter.default.post(name: NSNotification.Name("cloudkitLogin"), object: url);
}

API

  • authenticate(...)
  • fetchRecord(...)
  • Interfaces

authenticate(...)

authenticate(options: SignInOptions) => Promise<{ ckWebAuthToken: string; }>
ParamType
optionsSignInOptions

Returns: Promise<{ ckWebAuthToken: string; }>


fetchRecord(...)

fetchRecord(options: FetchRecordOptions) => Promise<any>

Only available on iOS.

ParamType
optionsFetchRecordOptions

Returns: Promise<any>


Interfaces

SignInOptions
PropType
containerIdentifierstring
environment'development' | 'production'
ckAPITokenstring
FetchRecordOptions
PropType
containerIdentifierstring
database'private' | 'public' | 'shared'
by'recordName'
recordNamestring

Keywords

FAQs

Package last updated on 05 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc