# groupKeyIdOf

> **groupKeyIdOf**(`metadata`): `` `0x${string}` `` \| `undefined`

Defined in: [derive.ts:399](https://github.com/FilOzone/synapse-sdk/blob/ef6c62c2d5e01c004a5cdb1a12bfa58ab9ee1834/packages/keysmith/src/derive.ts#L399)

The group key id a data set's metadata records under `foc/gkid`, canonical, or `undefined` if it records none.
A data set without `foc/gkid`, including one written by keysmith 0.1.0 (`foc/ks`), returns `undefined`, so a
lookup across a wallet's data sets skips it. `undefined` does not mean "not encrypted": a data set recording
`foc/ks`, or a `v1.` `foc/kc`, is a keysmith 0.1.0 encrypted data set, and an app should not add new data to it.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `metadata` | [`Readonly`](https://www.typescriptlang.org/docs/handbook/utility-types.html#readonlytype)\<[`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `string`\>\> |

## Returns

`` `0x${string}` `` \| `undefined`

## Throws

If the metadata is not an object, or `foc/gkid` is malformed or not a string.