Skip to content
  1. Tutorials
  2. Getting started
  3. Installation

Installation ​

Create a project with the official creator:

sh
npm create @linkurious/ogma my-app
sh
yarn create @linkurious/ogma my-app
sh
pnpm create @linkurious/ogma my-app

The CLI asks for:

  • Template: vite, webpack, rollup, typescript, node, or parcel
  • API key: the CLI adds it to the project for you.

To skip the prompt, pass a template:

sh
npm create @linkurious/ogma my-app -- --template vite

See Boilerplates for all templates.


Ogma ships in three files:

  • ogma.js: production build
  • ogma.dev.js: development build, with extra debugging features
  • ogma.umd.cjs: CommonJS and legacy environments

Client-side ​

Ogma works with module loaders and front-end frameworks. See the tutorials.

Add it as a project dependency. Choose one of these methods:

npm, pnpm, or yarn ​

Your API key is required. Find it in your Linkurious account. The install link there is the same as the one below.

sh
# NPM
npm install --save https://get.linkurio.us/api/get/npm/ogma/<VERSION>/?secret=<YOUR_API_KEY>
sh
# note the quotes around the URL, they are required for yarn to parse it correctly
yarn add "https://get.linkurio.us/api/get/npm/ogma/<VERSION>/?secret=<YOUR_API_KEY>"
sh
# same as npm)
pnpm install --save https://get.linkurio.us/api/get/npm/ogma/<VERSION>/?secret=<YOUR_API_KEY>

CI and automated installs ​

Keep the API key out of package.json and source control. See Installing in CI.

Downloaded tar.gz ​

Use this if company policy blocks external npm sources.

  1. Open the npm link above in a browser to download the .tar.gz file.
  2. Install it locally:
sh
npm install --save path/to/ogma-v.X.X.X.tar.gz

Single HTML page ​

  1. Download ogma.zip from get.linkurio.us.
  2. Extract it into your project folder.
  3. Load ogma.js in your page:
html
<script src="path/to/ogma.js"></script>

ES module ​

Ogma supports the UMD format and the ES module format:

js
import Ogma from '@linkurious/ogma';

Server-side ​

Use Ogma in Node.js:

ts
// Installed via npm
import Ogma from '@linkurious/ogma';

// Downloaded js file
import Ogma from 'path/to/ogma.js';