Domain methods: register, release, renew, search
The Domain Verbs register, release, renew, search as typed SDK methods, with inputs, result, refusals and an example.
Reference for Domain, one group of Domain methods.
Domain.register
Register buys a hostname for a Startup and points it at the Startup’s address. Verb page.
interface DomainVerbs {
register(input: DomainRegisterInput, options?: SB.CallOptions): SB.Call<Domain>
}Emits Domain.registered.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
hostname | string | required | The hostname to buy. |
startup | Startup | required | The Startup it serves. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
domain | Domain | required | The registered Domain. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The operation is part of an Offer the caller has not accepted or paid for. | payment-required | Accept the Offer named in the response, then retry the call. | Offer.accept |
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record changed since it was read, so the write would overwrite a newer version. | conflict | Read the record again, then retry the write against its current state. | None. |
Example
import { $ } from 'startup-builder'
const domain = await $.Domain.register({ hostname: 'kilnbakery.com', startup: 'startup_ROlZw7tNIz' })Domain.release
Release lets a Domain’s registration or claim end, keeping its record, history and aliases. Verb page.
interface DomainVerbs {
release(input: DomainReleaseInput, options?: SB.CallOptions): SB.Call<Domain>
}Emits Domain.released.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
domain | Domain | required | The Domain to let go. |
reason | text | required | Why it is released, recorded as a Decision. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
domain | Domain | required | The released Domain. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
A Domain whose carriedIdentity is true: it received mail, hosted a Mailbox or verified an outside account | refused | Clear what the check names, then call it again. | None. |
| A canonical Domain while the Startup is Live | refused | Clear what the check names, then call it again. | None. |
Example
import { $ } from 'startup-builder'
const domain = await $.Domain.release({ domain: 'domain_VbYut4CTsH', reason: 'Example reason' })Domain.renew
Renew extends a Domain’s registration by whole years at its renewal price, paid by its owner of record. Verb page.
interface DomainVerbs {
renew(input: DomainRenewInput, options?: SB.CallOptions): SB.Call<Domain>
}Emits Domain.renewed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
domain | Domain | required | The Domain to renew. |
years | integer | Years to add. Defaults to the Domain’s tier in the renewal Setting. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
domain | Domain | required | The Domain, with its new expiresAt. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const domain = await $.Domain.renew({ domain: 'domain_VbYut4CTsH' })Domain.search
Search lists candidate names with availability, first-year price, renewal price and the rules of each extension. Verb page.
interface DomainVerbs {
search(input: DomainSearchInput, options?: SB.CallOptions): SB.Call<Domain[]>
}Emits Domain.searched.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
query | string | required | A name, or a word to build names from. |
extensions | string[] | Extensions to check, such as com or ai. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
candidates | list of Domain | required | Candidate Domains, each with its prices, three-year cost and extension rules. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const candidates = await $.Domain.search({ query: 'Example query' })