Skip to content

Commit

Permalink
Update README and changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
domwebber committed Nov 20, 2024
1 parent 7d7d146 commit 8645e3e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
30 changes: 29 additions & 1 deletion .changeset/silver-deers-double.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,32 @@
"@great-detail/whatsapp": major
---

Rewrite SDK
Refactor & Rewrite SDK.

**Before**:

```ts
import CloudAPI from "@great-detail/whatsapp";

const sdk = new CloudAPI();
const message = sdk
.message({ phoneNumberID: "123...809" })
.text({ body: "Hello" }, { toNumber: "1234567890" });
const sendReceipt = await message.send();
```

**After**:

```ts
import Client from "@great-detail/whatsapp";

const sdk = new Client();
const message = await sdk.message.createMessage({
phoneNumberID: "123...809",
to: "1234567890",
type: "text",
text: {
body: "Hello",
},
});
```
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,21 @@ Originally a fork of the

## Getting started

```typescript
// ESM
**ESM Import**:

```ts
import Client from "@great-detail/whatsapp";
```

**CJS Import**:

// CJS
```ts
const CloudAPI = require("@great-detail/whatsapp").default;
```

**Usage**:

```typescript
const sdk = new Client();
const message = await sdk.message.createMessage({
phoneNumberID: "123...809",
Expand Down

0 comments on commit 8645e3e

Please sign in to comment.