Skip to content
SDKProductBuild and shipFlag

Flag methods: update, delete

The Flag Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for Flag, one group of Flag methods.

Flag.update

Changes the given properties of a Flag. Verb page.

TypeScript
interface FlagVerbs {
  update(input: FlagUpdateInput, options?: SB.CallOptions): SB.Call<Flag>
}

Emits Flag.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Flag.
keystringThe name code reads.
rulesjsonWho gets which value, including percentage splits.

Returns

OutputTypeRequiredDescription
flagFlagrequiredThe Flag.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const flag = await $.Flag.update({ id: 'flag_1YJLhjTlfx', key: 'new-checkout' })

Flag.delete

Deletes a Flag: a soft delete that keeps its history, undone by Thing.restore. Verb page.

TypeScript
interface FlagVerbs {
  delete(input: FlagDeleteInput, options?: SB.CallOptions): SB.Call<Flag>
}

Emits Flag.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Flag.

Returns

OutputTypeRequiredDescription
flagFlagrequiredThe Flag.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const flag = await $.Flag.delete({ id: 'flag_1YJLhjTlfx' })