[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › objectKeys

```ts
function objectKeys<Key>(
  key: Key & ValidateOutput<Key>,
): <T>(type: T & ValidateOutput<T>) => ObjectKeysType<Key, T>;
```

Defined in: [packages/common/src/Type.ts:13957](https://github.com/evoluhq/evolu/blob/dd96d79f1dbe9a49fa12ce8e0aa7d3d0177795ca/packages/common/src/Type.ts#L13957)

Renames a strict [object](https://evolu.dev/docs/api-reference/common/Type/functions/object) Type's encoded keys using a string codec.

The object declaration uses semantic keys. Each key must be a valid Output of
the key Type. Its canonical encoding becomes the external property name.
Decoding accepts those exact names; aliases and unknown properties are
rejected. Values, optionality, and semantic Output stay with the object Type.
Only the outer keys change. Nested field codecs keep their own behavior.

Construction rejects invalid schema keys, duplicate encodings, and key codecs
that do not decode their encodings back to the declared keys. These are
schema mistakes; invalid external values return normal Type errors. Error
paths use the external names, including missing required properties.

### Example

```ts
import {
  assertEqual,
  assertErr,
  assertOk,
  CamelCaseIdentifierFromConstantCaseIdentifier,
  object,
  objectKeys,
  optional,
  PortFromString,
  prefixed,
} from "@evolu/common";

const Key = prefixed("APP_")(CamelCaseIdentifierFromConstantCaseIdentifier);
const Settings = objectKeys(Key)(object({ port: optional(PortFromString) }));

const result = Settings.fromUnknown({ APP_PORT: "04000" });
assertOk(result, { port: 4000 });

assertEqual(Settings.to(result.value), { APP_PORT: "4000" });

assertErr(Settings.fromUnknown({ APP_POTR: "4000" }));
```