{"id":15511572,"url":"https://github.com/standardnotes/snjs","last_synced_at":"2025-10-12T08:32:04.488Z","repository":{"id":37764522,"uuid":"139340044","full_name":"standardnotes/snjs","owner":"standardnotes","description":"Core JavaScript logic shared by all Standard Notes clients.","archived":true,"fork":false,"pushed_at":"2022-07-06T11:55:19.000Z","size":166573,"stargazers_count":32,"open_issues_count":1,"forks_count":15,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-03T09:54:04.000Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/standardnotes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["standardnotes"]}},"created_at":"2018-07-01T15:25:28.000Z","updated_at":"2023-12-26T15:42:39.000Z","dependencies_parsed_at":"2022-07-31T23:48:42.406Z","dependency_job_id":null,"html_url":"https://github.com/standardnotes/snjs","commit_stats":null,"previous_names":[],"tags_count":1718,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/standardnotes%2Fsnjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/standardnotes%2Fsnjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/standardnotes%2Fsnjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/standardnotes%2Fsnjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/standardnotes","download_url":"https://codeload.github.com/standardnotes/snjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236188339,"owners_count":19109390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T09:53:07.435Z","updated_at":"2025-10-12T08:32:04.483Z","avatar_url":"https://github.com/standardnotes.png","language":"JavaScript","readme":"# SNJS\n\n[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)\n\nSNJS is a client-side JavaScript library for [Standard Notes](https://standardnotes.com) that contains shared logic for all Standard Notes clients.\n\n## Introduction\n\nSNJS is a shared library for use in all Standard Notes clients (desktop, web, and mobile). Its role is to extract any business or data logic from client code, so that clients are mostly responsible for UI-level code, and don’t have to think about encryption and key management, or even authentication or storage specifics. Extracting the code into a shared library also prevents us from having to write the same critical code on multiple platforms.\n\nThe entry point of SNJS is the [`SNApplication`](packages/snjs/lib/application.ts) class. The application class is a complete unit of application functionality. Theoretically, many instances of an application can be created, each with its own storage namespace and memory state. This can allow clients to support multiple user accounts.\n\nAn application must be supplied a custom subclass of [DeviceInterface](packages/snjs/lib/device_interface.ts). This allows the library to generalize all behavior a client will need to perform throughout normal client operation, such as saving data to a local database store, saving key/values, and accessing the keychain.\n\nOn Web platforms SNJS interacts with [`sncrypto`](https://github.com/standardnotes/snjs/tree/packages/sncrypto-common) to perform operations as mentioned in the [specification](https://github.com/standardnotes/snjs/blob/main/packages/snjs/specification.md) document. This includes operations like key generation and data encryption.\n\nSNJS also interacts with a Standard Notes [syncing server](https://github.com/standardnotes/syncing-server-js), which is a zero-knowledge data and sync store that deals with encrypted data, and never learns of client secrets or sensitive information.\n\n## Installation\n\n`yarn add snjs`\n\n## Integrating in module environment\n\n```javascript\nimport { SNApplication } from 'snjs';\n```\n\n## Integrating in non-module web environment\n\n```javascript\n\u003cscript src=\"snjs.js\"\u003e\u003c/script\u003e\nObject.assign(window, SNLibrary);\n```\n\n## Building\n\n1. `yarn install --pure-lockfile`\n2. `yarn start` to start Webpack in development mode (watches changes), or `yarn build` to create dist files.\n\n## Tests\n\n### E2E Tests\nEnsure you have [Docker](https://www.docker.com) and [Docker Compose](https://docs.docker.com/compose/install/) installed before running tests.\n\nFrom the root of the repository, run:\n\n```\n# Starts browser-navigable web page\nyarn run start:e2e:mocha\n\n# Starts backend servers\nyarn run start:e2e:docker\n```\n\nThen choose between the following run options:\n\n- Run tests in the command line:\n  ```\n  yarn run test:e2e:dev\n  ```\n\n- Run tests in the browser: Open `http://localhost:9002/packages/snjs/mocha/test.html`.\n\n### Unit Tests\n\nFrom the root of the repository, run:\n\n```\nyarn run test:unit\n```\n\n## Help\nJoin the #dev channel in [our Slack group](https://standardnotes.com/slack) or [Discord](https://standardnotes.com/discord) for help and discussion.\n","funding_links":["https://github.com/sponsors/standardnotes"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstandardnotes%2Fsnjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstandardnotes%2Fsnjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstandardnotes%2Fsnjs/lists"}