New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cloudkit-js

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudkit-js

A JS library for managing a CloudKit container

latest
Source
npmnpm
Version
0.0.8
Version published
Weekly downloads
36
111.76%
Maintainers
0
Weekly downloads
 
Created
Source

CloudKit JS

CloudKit JS aims to make it easy for you to manage your CloudKit container from your Node.js server.

It's as simple as this

import { CloudKitJs } from 'cloudkit-js';

const lib = new CloudKitJs({
    containerName: "iCloud.com.your.container.name",
    keyId: "xxx",
    privateKeyPath: "eckey.pem"
})

lib.createRecord({
    recordType: "MyRecordType",
    fields: {
        name: { value: "My new record" },
        description: { value: "Wow, so easy!" }
    }
})

Getting started

This assumes you've already an active Apple Developer membership and you've got your CloudKit container set up.

1. Create a server-to-server key in CloudKit

Go to CloudKit Dashboard, open your container, and click "Tokens & Keys" on the left menu.

Add a new "Server-to-Server Key" and follow the instructions.

2. Install the library

npm install --save cloudkit-js

3. Initialise the library

import { CloudKitJs } from 'cloudkit-js';

const lib = new CloudKitJs({
    containerName: "iCloud.com.your.container.name", // Update this with your CloudKit container name
    keyId: "xxx", // Put your key ID here
    privateKeyPath: "eckey.pem" // Point to your private key file
})

The keyId and privateKeyPath are the values you got from step 1.

Your Key ID is displayed when viewing the server-to-server key on the CloudKit Dashboard.

⚠️ These are secret, so obvz don't put them in source control.

Keywords

orm

FAQs

Package last updated on 18 Nov 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