Internal SDK
For more in-depth documentation please review the SDK Architecture and
the Internal SDK project's README.
Requirements
See the Tools and Libraries page for more information.
Setup instructions
-
Clone the repository:
git clone https://github.com/bitwarden/sdk-internal.git
cd sdk -
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-internal/
clients/
ios/
android/
Web clients
The web clients use 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. The
web SDK has two targets (OSS and Bitwarden License) and the following command links both of them:
npm link ../sdk-internal/crates/bitwarden-wasm-internal/npm ../sdk-internal/crates/bitwarden-wasm-internal/bitwarden_license/npm
If you only want to link one of the versions, you can run the command with only one of the paths.
Keep in mind that running npm link will restore any previously linked packages, so only the paths
in the last run command will be linked.
Running npm ci or npm install will replace the linked packages with the published version.
Mobile
Android
-
Build and publish the SDK to the local Maven repository:
../sdk-internal/crates/bitwarden-uniffi/kotlin/publish-local.sh -
Set the user property
localSdk=truein theuser.propertiesfile.
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