Bixby Developer Center

Guides
References

Library Capsules

This section describes how to use Bixby's library capsules, which let your capsules work with complex concepts such as dates, times, and geography.

Using Capsules

To use a library capsule, it must be imported. In your capsule.bxb file, include an import statement in the capsule-imports block:

capsule {
capsule-imports {
import (viv.time) {
as (time) version (2.58.56)
}
}
}

This import lets you refer to concepts and actions in the viv.time.* namespace simply with time.*.

Capsules import their own dependencies (for example, viv.contact relies on viv.geo, viv.time, and other library capsules); your capsule does not need to import these separately.

Library Capsule Versions

Last updated March 12, 2020

When importing library capsules, these are the current versions to specify:

Library CapsuleVersion
bixby.audioPlayer1.1.11
viv.common4.0.3
viv.contact2.5168.4
viv.entity4.0.14
viv.geo9.26.19
viv.image2.12.12
viv.location1.0.38
viv.measurement2.14.11
viv.money2.22.26
viv.navigation1.9.34
viv.openHours4.1.22
viv.rating3.2.13
viv.self3.5.215
viv.shareVia0.4020.9
viv.time3.1.102

Importing Capsule Versions

Instead of indicating a version for each imported capsule, once you import a library, you should use version-from to transitively import any of its dependencies. This is useful in order to keep versions aligned and prevent your capsule dependency chain from using two different versions of the same imported capsule.

Because of the transitive nature of version-from, you only have to point to a capsule that indirectly imports that capsule.

In the example below, the capsule first specifies the version when importing viv.location. It then uses the capsule to get capsule versions for another imported capsule, viv.geo.

capsule {
id (example.locationSearch)
version (1.0.2)
format (3)
targets {
target (bixby-mobile-en-US)
}
capsule-imports {
import (viv.location) { as (location) version (1.0.36)}
import (viv.geo) { as (geo) version-from (location)}
}
permissions {
user-profile-access
}
runtime-version (3)
store-sections {
section (TravelAndTransportation)
}
store-countries {
all
}
}

View on GitHub

Capsules

These are some of the most commonly used library capsules along with links to further discussion.