Migrating from Credo 0.6.x to 0.7.x
This document describes everything you need to know for updating Credo 0.6.x to 0.7.x. If you're not aware of how updating in Credo works make sure to first read the guide on Updating Credo.
Compared to the 0.5 → 0.6 update, 0.7.0 is a much smaller release. The main changes are:
- Updated native crypto backends:
@hyperledger/anoncreds-*,@hyperledger/indy-vdr-*and@openwallet-foundation/askar-*have been bumped to their new stable releases. - No more
ffi-napi/ref-napion Node.js: the new Askar, AnonCreds and Indy VDR native bindings no longer depend onffi-napiandref-napi. This removes a long-standing source of native build issues and unlocks support for modern Node.js versions. - Node.js 24 support: the new native bindings support Node.js 24. Node.js 20 may still work but is no longer supported.
- A few API cleanups in
@credo-ts/corearound encoding utilities and theLogLevelenum.
Follow the steps below carefully to make the upgrade as smooth as possible.
Dependency Updates
Update the following dependencies in your package.json to the new versions. The crypto backend packages must be bumped together with Credo to avoid mixing incompatible native binaries (you may want to pin these via resolutions / overrides in your package.json so that transitive dependencies don't pull older versions).
React Native
"@credo-ts/core": "^0.7.0""@credo-ts/didcomm": "^0.7.0""@credo-ts/askar": "^0.7.0""@credo-ts/anoncreds": "^0.7.0""@credo-ts/openid4vc": "^0.7.0""@credo-ts/react-native": "^0.7.0""@credo-ts/tenants": "^0.7.0""@credo-ts/cheqd": "^0.7.0""@credo-ts/indy-vdr": "^0.7.0""@openwallet-foundation/askar-react-native": "^0.6.0""@hyperledger/anoncreds-react-native": "^0.4.0""@hyperledger/indy-vdr-react-native": "^0.3.0"
Node
"@credo-ts/core": "^0.7.0""@credo-ts/didcomm": "^0.7.0""@credo-ts/askar": "^0.7.0""@credo-ts/anoncreds": "^0.7.0""@credo-ts/openid4vc": "^0.7.0""@credo-ts/node": "^0.7.0""@credo-ts/tenants": "^0.7.0""@credo-ts/cheqd": "^0.7.0""@credo-ts/indy-vdr": "^0.7.0""@openwallet-foundation/askar-nodejs": "^0.6.0""@hyperledger/anoncreds-nodejs": "^0.4.0""@hyperledger/indy-vdr-nodejs": "^0.3.0"
No more ffi-napi / ref-napi (Node.js)
The new Askar (@openwallet-foundation/askar-nodejs@^0.6.0), AnonCreds (@hyperledger/anoncreds-nodejs@^0.4.0) and Indy VDR (@hyperledger/indy-vdr-nodejs@^0.3.0) Node.js bindings no longer depend on ffi-napi and ref-napi. These two libraries were a recurring source of pain when installing Credo:
- They required a C/C++ toolchain and Python on the host machine to build.
- They were slow to get updated for new Node.js versions, which effectively blocked Credo users from upgrading Node.js.
If your project's package.json (or a postinstall script) still references ffi-napi or ref-napi, you can safely remove those entries.
Supported Node.js versions
With the new native bindings, Credo 0.7.x officially supports Node.js 22 and 24. Node.js 20 may still work in practice, but it is no longer supported; we recommend upgrading to Node.js 22 or 24 as part of this migration.
Breaking Code Changes
This section lists the breaking changes to the public API of Credo between 0.6.x and 0.7.x.
If you have custom modules there could be additional breaking changes that aren't documented here. Feel free to open a pull request on the Credo Docs repository if you find one.
Buffer is no longer exported from @credo-ts/core
In 0.6.x, @credo-ts/core re-exported Buffer as a convenience. This re-export has been removed. Use TypedArrayEncoder instead (or import Buffer from its regular location if you really need it — in Node.js it's a global, and in React Native it's available through the standard buffer polyfill).
0.6.x
import { Buffer } from '@credo-ts/core'
const bytes = Buffer.from(str)
const utf8 = Buffer.from(b64, 'base64').toString('ascii')
0.7.x
import { TypedArrayEncoder } from '@credo-ts/core'
const bytes = TypedArrayEncoder.fromUtf8String(str)
const utf8 = TypedArrayEncoder.toUtf8String(TypedArrayEncoder.fromBase64(b64))
TypedArrayEncoder method renames
Several methods on TypedArrayEncoder have been renamed for consistency:
| 0.6.x | 0.7.x |
|---|---|
fromString(s) | fromUtf8String(s) |
toBase64URL(u8) | toBase64Url(u8) |
fromBase64URL(s) | fromBase64Url(s) |
JsonEncoder method renames
JsonEncoder methods that used to work with Buffer now work with Uint8Array and have been renamed accordingly:
| 0.6.x | 0.7.x |
|---|---|
fromBuffer(data) | fromUint8Array(data) |
toBuffer(json) | toUint8Array(json) |
LogLevel enum keys are now PascalCase
The LogLevel enum keys have been renamed from lowercase to PascalCase to align with the rest of Credo's enums.
0.6.x
import { LogLevel } from '@credo-ts/core'
const level = LogLevel.debug
// LogLevel.test, LogLevel.trace, LogLevel.debug, LogLevel.info,
// LogLevel.warn, LogLevel.error, LogLevel.fatal
0.7.x
import { LogLevel } from '@credo-ts/core'
const level = LogLevel.Debug
// LogLevel.Test, LogLevel.Trace, LogLevel.Debug, LogLevel.Info,
// LogLevel.Warn, LogLevel.Error, LogLevel.Fatal
The numeric values are unchanged (Test = 0 … Fatal = 6), so any serialized configuration values still map correctly. Only the TypeScript/JavaScript identifier casing has changed.