Skip to content

Latest commit

 

History

History
66 lines (42 loc) · 2.09 KB

README.md

File metadata and controls

66 lines (42 loc) · 2.09 KB

gosn-v2

Build Status CircleCI GoDoc Go Report Card

This release adds support for version 004 of encryption (introduced Nov 2020) and removes support for 003.

Note: This is an early release with significant changes. Please take a backup before using with any real data and report any issues you find.

about

Standard Notes is a service and application for the secure management and storage of notes.

gosn-v2 is a library to help develop your own application to manage notes on the official, or your self-hosted, Standard Notes server.

documentation

basic usage

The following example shows how to use this library to interact with the SN API directly. To prevent a full download of all items on every sync, use the provided cache package to persist an encrypted copy to disk, only syncing deltas on subsequent calls.

installation

GO111MODULE=on go get -u github.com/jonhadfield/gosn-v2

importing

import "github.com/jonhadfield/gosn-v2"

basic usage

authenticating

Sign-in to obtain your session

sio, _ := gosn.SignIn(gosn.SignInInput{
    Email:    "user@example.com",
    Password: "topsecret",
})

initial sync

An initial sync is required to retrieve your items, as well as your Items Keys that are then added to your session

so, _ := gosn.Sync(gosn.SyncInput{
    Session: &sio.Session,
})

decrypt and parse items

items, _ := so.Items.DecryptAndParse(&sio.Session)