# @crediful/core

> Crediful for Web's communication core.

Latest version **2.6.6** (published 2018-05-11) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @crediful/core
pnpm add @crediful/core
yarn add @crediful/core
bun add @crediful/core
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.6.6 |
| Published | 2018-05-11 |
| First published | 2018-05-11 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | crediful-owner |

## Links

- npm: https://www.npmjs.com/package/@crediful/core
- Repository: https://github.com/crediful/crediful-web-packages/tree/master/packages/core
- npm.io page: https://npm.io/package/@crediful/core

## Dependencies (8)

- [logdown](https://npm.io/package/logdown.md) 3.2.3
- [bazinga64](https://npm.io/package/bazinga64.md) 5.1.8
- [pure-uuid](https://npm.io/package/pure-uuid.md) 1.5.2
- [protobufjs](https://npm.io/package/protobufjs.md) 6.8.6
- [@types/node](https://npm.io/package/@types/node.md) 10.0.6
- [@crediful/cryptobox](https://npm.io/package/@crediful/cryptobox.md) 8.3.47
- [@crediful/api-client](https://npm.io/package/@crediful/api-client.md) 0.8.16
- [@crediful/store-engine](https://npm.io/package/@crediful/store-engine.md) 0.11.6

## Recent versions

- 2.6.6 (latest) — 2018-05-11

## README

# Crediful

This repository is part of the source code of Crediful. You can find more information at [crediful.io](https://crediful.io) or by contacting opensource@crediful.io.

You can find the published source code at [github.com/crediful](https://github.com/crediful).

For licensing information, see the attached LICENSE file and the list of third-party licenses at [crediful.io/legal/licenses/](https://crediful.io/legal/licenses/).

## Core

Crediful for Web's communication core.

### Example

```bash
yarn add @crediful/core@0.0.30
```

#### JavaScript (Node.js)

```javascript
const {Account} = require('@crediful/core');

const account = new Account();

account.on(Account.INCOMING.TEXT_MESSAGE, ({conversation, content}) => {
  account.service.conversation.sendTextMessage(conversation, `Echo: ${content}`);
});

account.listen({
  email: 'name@email.com',
  password: 'secret',
  persist: false,
});
```

#### TypeScript

```typescript
import {Account} from '@crediful/core';
import {PayloadBundle} from '@crediful/core/dist/commonjs/cryptography/';
import {LoginData} from '@crediful/api-client/dist/commonjs/auth/';

const account: Account = new Account();

const login: LoginData = {
  email: 'name@email.com',
  password: 'secret',
  persist: false,
};

account.on(Account.INCOMING.TEXT_MESSAGE, (data: PayloadBundle) => {
  account.service.conversation.sendTextMessage(data.conversation, data.content);
});

account.listen(login).catch(error => {
  console.error(error.stack);
  return process.exit(1);
});
```

---
_Source: https://npm.io/package/@crediful/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
