> For the complete documentation index, see [llms.txt](https://docs.twine.world/twine-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.twine.world/twine-js/twine-protocol/twine-builder/index.md).

# index

**@twine-protocol/twine-builder v0.1.0** • **Docs**

***

[twine-js](/twine-js/index.md) / @twine-protocol/twine-builder

## @twine-protocol/twine-builder

This package is used to build Twine objects.

In order to create Twine objects you need a Signer. The [JoseSigner](/twine-js/twine-protocol/twine-builder/classes/josesigner.md) class is the easiest way to get started.

### Example

```js
const signer = await JoseSigner.fromRandomness('RS256', { modulusLength: 2048 })
const chain = await createChain({ source: 'some-service.com', links_radix: 3 }, signer)
await chain.verifySignature() // should not throw

const first = await createPulse(chain, false, {
  foo: 'some data',
}, signer)
await first.verifySignature(chain) // should not throw

const previous = first
const next = await createPulse(chain, previous, {
  foo: 'some more data',
}, signer)
// etc...
```

### Interfaces

| Interface                                                                                               | Description                           |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| [UnsanitizedChainContent](/twine-js/twine-protocol/twine-builder/interfaces/unsanitizedchaincontent.md) | Chain content accepted by the builder |

### Functions

| Function                                                                         | Description            |
| -------------------------------------------------------------------------------- | ---------------------- |
| [getNextLinks](/twine-js/twine-protocol/twine-builder/functions/getnextlinks.md) | Next pulses skip links |
| [createChain](/twine-js/twine-protocol/twine-builder/functions/createchain.md)   | Create a new chain     |
| [createPulse](/twine-js/twine-protocol/twine-builder/functions/createpulse.md)   | Create a new pulse     |

### Signer

| Class                                                                      | Description                                        |
| -------------------------------------------------------------------------- | -------------------------------------------------- |
| [JoseSigner](/twine-js/twine-protocol/twine-builder/classes/josesigner.md) | A signer that uses the jose library to sign twines |
