title: "Getting Started" order: 1

Getting Started with Cadastry SDK

Warning

Cadastry SDK is currently in private beta. To get early access and start building with Cadastry, please reach out to our team.

Installation

Install the SDK using npm:

npm install @cadastry/sdk

Or using yarn:

yarn add @cadastry/sdk

Basic Setup

First, import the necessary components:

import  createDocument, createActor, generateCadastryKeypair  from '@cadastry/sdk';

Initialize the SDK in your application:

// Generate a keypair for your actor
const keys = generateCadastryKeypair();
 
// Create an actor
const actor = createActor(
  record: 
    type: 'actor',
    name:  type: 'string', value: 'John Doe' ,
    actor: 
      type: 'person'
    
  
, 'actor.person', [keys]);

Quick Start Guide

1. Creating a Document

const document = createDocument(
  class: 'record.object',
  record: 
    type: 'object',
    name:  type: 'string', value: 'My First Document' 
  
, actor.CDID);

2. Signing a Document

const signedDocument = addSignature(document, actor.CDID, keys);

3. Uploading to Chain

const uploadedDocument = await uploadDocumentToChain(signedDocument);

4. Retrieving a Document

const retrievedDocument = await getDocument(uploadedDocument.CDID);

Next Steps