Expand description
§bitwarden-wasm-internal
Note: This is only for internal use. Bitwarden will not provide any support for this crate.
Bitwarden WASM internal exposes WebAssembly bindings for the Bitwarden SDK. This crate should contain no logic but rather only handle WASM unique conversions and bindings. Business logic MUST be placed in the relevant feature crates.
§Getting Started
§Requirements
wasm32-unknown-unknownrust target.binaryeninstalled forwasm-optandwasm2js.- npm packages must be installed in the
npmfolder. Runnpm ciinside:- OSS:
crates/bitwarden-wasm-internal/npm - Commercial:
crates/bitwarden-wasm-internal/bitwarden_license/npm
- OSS:
rustup target add wasm32-unknown-unknown
brew install binaryen§Building
# dev
./build.sh
# dev with commercial license
./build.sh -b
# release
./build.sh -r
# release with commercial license
./build.sh -r -bModules§
- client 🔒
- custom_
types 🔒 - flight_
recorder 🔒 - WASM bindings for the Flight Recorder.
- init 🔒
- platform 🔒
- pure_
crypto 🔒 - ssh 🔒
Structs§
- Autotype
Credentials - The credentials the render process found for an
AutotypeGetCredentialsRequest. - Autotype
GetCredentials Request - A request from the main process, sent when the user presses the Autotype shortcut, asking the render process for the credentials to autotype into the focused app.
- Autotype
GetCredentials Response - A response to an
AutotypeGetCredentialsRequest. - Autotype
List Running Apps Request - A request asking the receiving client for the applications that are currently running.
- Autotype
List Running Apps Response - A response to an
AutotypeListRunningAppsRequest. - Autotype
Running App - A running application.
- Autotype
SetEnabled Request - A request asking the receiving client to enable or disable Autotype.
- Autotype
SetEnabled Response - A response to an
AutotypeSetEnabledRequest. - Autotype
SetKeyboard Shortcut Request - A request asking the receiving client to change the keyboard shortcut Autotype is triggered by.
- Autotype
SetKeyboard Shortcut Response - A response to an
AutotypeSetKeyboardShortcutRequest. - Channel
Error - Debug
Client - Root of the debug-capability tree. Routes to per-crate capability handles.
- Deserialize
Error - Emergency
Access Client - Client for emergency access operations, performed as the grantor or the grantee.
- Emergency
Access Id - NewType wrapper for
EmergencyAccessId - Flight
Recorder Client - WASM client for reading Flight Recorder logs.
- Grantee
Emergency Access - An emergency access seen by the grantor, describing the trusted grantee.
- Grantor
Emergency Access - An emergency access seen by the grantee, describing the grantor who trusts them.
- Invite
Link Admin Client - Client for organization invite link administrative (organization-key) operations: creating, refreshing, updating, deleting, and inspecting invite links. Returned views carry the recovered invite secret in their URL fragment.
- Invite
Link Client - Client for organization invite link operations.
- Invite
Link User Client - Client for organization invite link invitee (user) operations: checking link status, validating email eligibility, and accepting or self-confirming an invite.
- IpcEndpoint
Send Result - The outcome of delivering a broadcast message to one member of a [
BroadcastGroup]. JavaScript counterpart of [EndpointSendResult]. - JsCommunication
Backend - JavaScript implementation of the
CommunicationBackendtrait for IPC communication. - JsCommunication
Backend Sender - JavaScript interface for handling outgoing messages from the IPC framework.
- JsIpc
Client - JavaScript wrapper around the IPC client. For more information, see the
[
IpcClient] trait documentation. - JsIpc
Client Subscription - JavaScript wrapper around the IPC client subscription. For more information, see the [IpcClientSubscription] documentation.
- JsServer
Communication Config Client - JavaScript wrapper for ServerCommunicationConfigClient
- JsServer
Communication Config Platform Api - Thread-safe JavaScript implementation of ServerCommunicationConfigPlatformApi
- JsServer
Communication Config Repository - Thread-safe JavaScript implementation of ServerCommunicationConfigRepository
- JsSession
Repository - Thread safe JavaScript implementation of the
SessionRepositorytrait for IPC sessions. - Managed
Settings Client - Handle to the host system’s Unified Endpoint Management profile.
- Organization
Invite Link SsoView - SSO details for an organization referenced by an invite link status.
- Organization
Invite Link Status View - The status of an organization invite link, used to verify basic availability before an invitee attempts to accept.
- Organization
Invite Link View - An organization invite link with reconstructed URL for display by the client.
- Organization
User Bulk Response - The outcome of a bulk member operation for one organization member.
- Organization
Users Management Client - Client for administering the members of an organization.
- Password
Manager Client - The main entry point for the Bitwarden SDK in WebAssembly environments
- RawJs
Autotype Driver - JavaScript implementation of the various Autotype operations.
- RawJs
Autotype Render Driver - JavaScript implementation of the Autotype operations applied in the render process.
- RawJs
Server Communication Config Platform Api - JavaScript interface for the ServerCommunicationConfigPlatformApi
- RawJs
Server Communication Config Repository - JavaScript interface for the ServerCommunicationConfigRepository
- RawJs
Session Repository - JavaScript interface for handling outgoing messages from the IPC framework.
- RawJs
Shared Unlock Driver - JavaScript implementation of shared unlock operations used by shared unlock protocol.
- Shared
Unlock Peer - Shared-unlock peer for WASM clients.
- State
Debug - Typed debug handle over the SDK’s state registry: a generic browse across every registered repository, both client-managed and SDK-managed.
Enums§
- Accept
Invite Link Error - Errors returned from
crate::InviteLinkUserClient::accept_and_optionally_confirm. - Account
Recovery V2Upgrade Error - Errors returned when upgrading members’ account recovery keys.
- Emergency
Access Accept Error - Errors returned when accepting an emergency access invite.
- Emergency
Access Approve Error - Errors returned when approving an emergency access request.
- Emergency
Access Confirm Error - Errors returned when confirming an emergency contact.
- Emergency
Access Delete Error - Errors returned when deleting an emergency access.
- Emergency
Access GetError - Errors returned when fetching an emergency access.
- Emergency
Access GetGrantor Policies Error - Errors returned when fetching the policies that apply to a grantor.
- Emergency
Access Initiate Error - Errors returned when requesting emergency access.
- Emergency
Access Invite Error - Errors returned when inviting an emergency contact.
- Emergency
Access List Granted Error - Errors returned when listing the emergency accesses granted to the current user.
- Emergency
Access List Trusted Error - Errors returned when listing the current user’s trusted emergency contacts.
- Emergency
Access Reinvite Error - Errors returned when re-sending an emergency access invite.
- Emergency
Access Reject Error - Errors returned when rejecting an emergency access request.
- Emergency
Access Status - Where an emergency access is in its lifecycle.
- Emergency
Access Takeover Error - Errors returned when taking over a grantor’s account through emergency access.
- Emergency
Access Type - What the grantee may do once access is granted.
- Emergency
Access Update Error - Errors returned when editing an emergency access.
- Emergency
Access View Error - Errors returned when viewing a grantor’s vault items through emergency access.
- Invite
Link Error - Errors returned from invite link client operations, except accepting an invite (see
AcceptInviteLinkError). - Organization
Users Management Error - Errors returned from
OrganizationUsersManagementClientoperations. - Wasm
Communication Error - Error type for the WASM communication backend’s send and receive operations.
Traits§
- Emergency
Access Client Ext - Extension trait that exposes
EmergencyAccessClienton [Client]. - Invite
Link Client Ext - Extension trait that exposes
InviteLinkClienton [Client]. - Organization
Users Management Client Ext - Extension trait exposing
OrganizationUsersManagementClienton [Client].
Functions§
- autotype_
request_ get_ credentials - Sends an
AutotypeGetCredentialsRequestto the desktop render process, asking for the credentials to autotype into the focused app. The response’scredentialsis empty when no vault item matches. - autotype_
request_ list_ running_ apps - Asks the desktop main process which applications are currently running.
- autotype_
request_ set_ enabled - Sends an
AutotypeSetEnabledRequestto the desktop main process and reports whether the requested change was successful. - autotype_
request_ set_ keyboard_ shortcut - Sends an
AutotypeSetKeyboardShortcutRequestto the desktop main process and reports whether the requested shortcut was applied. - init_
sdk - Initialize the SDK. Must be called before using any other API. Only the first invocation has effect; subsequent calls are ignored.
- ipc_
register_ discover_ handler - Registers a DiscoverHandler so that the client can respond to DiscoverRequests.
- ipc_
request_ discover - Sends a DiscoverRequest to the specified destination and returns the response.
- register_
autotype_ handlers - This registers the Autotype handlers so the client responds to Autotype requests through
the
RawJsAutotypeDriver. Call this on the desktop main process’s IPC client. - register_
autotype_ render_ handlers - This registers the Autotype handlers so the client responds to Autotype requests from the
main process through the
RawJsAutotypeRenderDriver. Call this on the desktop render process’s IPC client.