Appearance
Installation
Quick start (recommended)
Create a project with the official creator:
sh
npm create @linkurious/ogma my-appsh
yarn create @linkurious/ogma my-appsh
pnpm create @linkurious/ogma my-appThe 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 viteSee 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.
- Open the npm link above in a browser to download the
.tar.gzfile. - Install it locally:
sh
npm install --save path/to/ogma-v.X.X.X.tar.gzSingle HTML page
- Download ogma.zip from get.linkurio.us.
- Extract it into your project folder.
- Load
ogma.jsin 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';