Skip to main content

Internal SDK

For more in-depth documentation please review the SDK Architecture and the Internal SDK project's README.

Requirements

  • Rust latest stable version - (preferably installed via rustup)
  • NodeJS and NPM.

See the Tools and Libraries page for more information.

Setup instructions

  1. Clone the repository:

    git clone https://github.com/bitwarden/sdk-internal.git
    cd sdk
  2. Install the dependencies:

    npm ci

Building the SDK

The SDK is built for different platforms, all of which have their own build instructions. For more information on how to build for a specific platform, refer to the readmes for the different crates:

  • Web: crates/bitwarden-wasm-internal
  • iOS: crates/bitwarden-uniffi/swift
  • Android: crates/bitwarden-uniffi/kotlin

Please be aware that each platform has its own set of dependencies that need to be installed before building. Make sure to double check the readme if you encounter any issues.

Linking the SDK to clients

After modifying the SDK, it can be beneficial to test the changes in the client applications. To do so you will need to update the SDK reference in the client applications.

These instructions assumes you have a directory structure similar to:

sdk/
clients/
ios/
android/

Web clients

The web clients uses NPM to install the SDK as a dependency. NPM offers a dedicated command link which can be used to temporarily replace the packages with a local version.

npm link ../sdk-internal/crates/bitwarden-wasm-internal/npm
warning

Running npm ci or npm install will replace the linked packages with the published version.

Mobile

Android

  1. Build and publish the SDK to the local Maven repository:

    ../sdk-internal/crates/bitwarden-uniffi/kotlin/publish-local.sh
  2. Set the user property localSdk=true in the user.properties file.

iOS

Run the bootstrap script with the LOCAL_SDK environment variable set to true in order to use the local SDK build:

LOCAL_SDK=true ./Scripts/bootstrap.sh