Install
During early access, the SDK comes from Nitrakit's package registry. You get an access
token with your invite: it lets your machines and your CI download the packages. Keep it out
of your repository, the same as any other credential: the steps below read it from an
environment variable (NITRAKIT_TOKEN) or from your user-level Gradle settings.
No token yet? Request early access.
- Web
- React Native
- Android
- iOS
The web SDK is @nitrakit/web, with @nitrakit/react, @nitrakit/vue, @nitrakit/svelte and
@nitrakit/angular on top. Point the @nitrakit scope at the registry in your project's
.npmrc (safe to commit: the token comes from the environment):
@nitrakit:registry=https://packages.nitrakit.dev/api/packages/nitrakit/npm/
//packages.nitrakit.dev/api/packages/nitrakit/npm/:_authToken=${NITRAKIT_TOKEN}
Then, with NITRAKIT_TOKEN set:
npm install @nitrakit/web # or @nitrakit/react, @nitrakit/vue, @nitrakit/svelte, @nitrakit/angular
pnpm and Yarn (v1) read the same .npmrc. For Yarn 2+, add the scope to .yarnrc.yml:
npmScopes:
nitrakit:
npmRegistryServer: "https://packages.nitrakit.dev/api/packages/nitrakit/npm/"
npmAuthToken: "${NITRAKIT_TOKEN}"
The package is @nitrakit/react-native. Add the same .npmrc as for the web:
@nitrakit:registry=https://packages.nitrakit.dev/api/packages/nitrakit/npm/
//packages.nitrakit.dev/api/packages/nitrakit/npm/:_authToken=${NITRAKIT_TOKEN}
npm install @nitrakit/react-native react-native-nitro-modules
-
iOS: the native SDK ships inside the package. Run
pod install. -
Android: Gradle downloads the native SDK from the registry too. Give it the token in your user-level Gradle settings (or set
NITRAKIT_TOKENin the environment, e.g. on CI):~/.gradle/gradle.propertiesnitrakitToken=<your token>
Add the registry to your repositories, with the token from your user-level Gradle settings:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url = uri("https://packages.nitrakit.dev/api/packages/nitrakit/maven")
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = "token ${providers.gradleProperty("nitrakitToken").get()}"
}
authentication { create<HttpHeaderAuthentication>("header") }
}
}
}
nitrakitToken=<your token>
Then add the SDK to your app module:
dependencies {
implementation("dev.nitrakit:nitrakit:0.1.0")
}
The SDK is the Swift package nitrakit.Nitrakit, served by a Swift package registry. Set the
registry up once on your Mac (and on CI):
swift package-registry set --global --scope nitrakit \
https://packages.nitrakit.dev/api/packages/nitrakit/swift
swift package-registry login https://packages.nitrakit.dev/api/packages/nitrakit/swift \
--username token --password <your token>
The login is stored in your keychain. Then add the package:
-
Xcode: File → Add Package Dependencies, search for
nitrakit.Nitrakit, and add theNitrakitandNitrakitUIproducts to your app target. -
Package.swift:
dependencies: [.package(id: "nitrakit.Nitrakit", from: "0.1.0")],// in your target:.product(name: "NitrakitUI", package: "nitrakit.Nitrakit"),
Versions
All packages share one version number and are released together. Use the same version on every platform you ship.