# Migrating to WebSdk 0.6.8-prerelease
This update contains significant breaking changes to the api. We're aiming for these to be the last breaking changes before beta, so hopefully you won't have to do another migration like this anytime soon.
The intention of these changes is to bring the web-sdk api more in alignment with [@holochain/client](https://www.npmjs.com/package/@holochain/client), which will also be getting an update soon to bring the two apis even closer.
## Changes
There are three major areas of change
### `zomeCall` renamed to `callZome`
Anywhere you currently have `client.zomeCall`, replace it with `client.callZome`
### `callZome` results changed
`callZome` used to return an enum shaped object with `type` and `data` fields. Type was one of `"ok"` and `"error"`, and `data` was either the zome call result or the error message.
Now, in the succesful case, `callZome` returns the result (what used to be `data`) directly, and in the error case, it wraps the error (what used to be `data`) in a `new Error(data)` and throws that.
Example migration
```
// old code
const result = await client.zomeCall(args)
if (result.type === 'ok') {
return result.data
}
if (result.type === 'error') {
console.error(result.data)
return
}
// becomes
let result
try {
result = await client.zomeCall(args)
} catch (e) {
console.error(e.message)
return
}
return result
```
### Signal format changed
```
type OldSignal = {
data: unknown,
dna_hash: Uint8Array
}
type NewSignal = {
data: unknown,
cell: InstalledCell
}
```
where
```
type InstalledCell = {
cell_id: [Uint8Array, Uint8Array]
role_id: string
}
```
`cell_id[0]` is `dna_hash`, so you still have access to it, but most things you might have been doing with `dna_hash` will be easier done with `role_id`.
### Bonus: Exported types
This is not a breaking change, but useful to know:
Web-sdk now exports the following types
```
type CallZomeArgs = {
roleId: RoleId,
zomeName: string,
fnName: string,
capSecret?: CapSecret,
payload: any
}
// This is the interface that web-sdk implements, and that holochain/client will soon implement as well
interface AppAgentClient extends EventEmitter {
callZome(args: CallZomeArgs): Promise<any>;
appInfo(): Promise<AppInfoResponse>
}
// emitted by `signal` events from web-sdk
type HoloSignal = {
data: unknown,
cell: InstalledCell
}
// emitted by `agent-state` events from web-sdk, and also the type of client.agent
type AgentState = {
id: string,
is_anonymous: boolean,
host_url: string,
is_available: boolean,
unrecoverable_error: any,
should_show_form?: boolean
}
```