> For the complete documentation index, see [llms.txt](https://bittu-1.gitbook.io/meshkit-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bittu-1.gitbook.io/meshkit-documentation/getting-started.md).

# Getting Started

MeshKit is a TypeScript SDK for storing and retrieving application data on decentralized storage. The current implementation uses Pinata as the storage provider and writes data to IPFS.

```
Meshkit
  -> StorageProvider
    -> PinataProvider
      -> Pinata IPFS
```

## Documentation Navigation

* [Getting Started](/meshkit-documentation/getting-started.md)
* [Installation](/meshkit-documentation/installation.md)
* [Authentication](/meshkit-documentation/authentication.md)
* [Architecture Overview](/meshkit-documentation/architecture.md)
* [Error Handling](/meshkit-documentation/error-handling.md)
* [API Reference Overview](/meshkit-documentation/api-reference.md)
* API Reference
  * [init()](/meshkit-documentation/api/init.md)
  * [testConnection()](/meshkit-documentation/api/testconnection.md)
  * [store()](/meshkit-documentation/api/store.md)
  * [retrieve()](/meshkit-documentation/api/retrieve.md)
  * [upload()](/meshkit-documentation/api/upload.md)
  * [download()](/meshkit-documentation/api/download.md)
  * [send()](/meshkit-documentation/api/send.md)
  * [receive()](/meshkit-documentation/api/receive.md)
  * [revoke()](/meshkit-documentation/api/revoke.md)

## Quick Example

```ts
const mk = await Meshkit.init({
  provider: "pinata",
  providerToken: process.env.PINATA_JWT!,
});

const record = await mk.store({
  hello: "world",
});

const data = await mk.retrieve(record.cid);

console.log(data);
```

## Quickstart

Initialize MeshKit with a Pinata JWT, test the connection, then store and retrieve JSON data.

```ts
import { Meshkit } from "../src/meshkit/Meshkit";

const meshkit = await Meshkit.init({
  provider: "pinata",
  providerToken: "PINATA_JWT",
});

const connected = await meshkit.testConnection();

if (!connected) {
  throw new Error("Could not connect to Pinata");
}

const record = await meshkit.store({
  invoiceId: "INV-1001",
  total: 2499,
  currency: "INR",
});

console.log(record.cid);

const invoice = await meshkit.retrieve<{
  invoiceId: string;
  total: number;
  currency: string;
}>(record.cid);

console.log(invoice.invoiceId);
```

## Current Capabilities

MeshKit currently supports:

* Initializing a storage client with `Meshkit.init()`
* Testing Pinata authentication with `testConnection()`
* Storing JSON-compatible data with `store()`
* Retrieving JSON-compatible data with `retrieve()`
* Uploading `Blob` or `File` objects with `upload()`
* Downloading files as `Blob` objects with `download()`
* Storing simple recipient messages with `send()`
* Reading stored messages with `receive()`
* Unpinning CIDs from Pinata with `revoke()`

## Platform Support

MeshKit is implemented in TypeScript and uses Web Platform APIs such as `fetch`, `Blob`, `File`, and `FormData`.

The current implementation is tested in an Ionic application.

Planned, not yet implemented:

* React Native integration guidance
* Flutter integration guidance
* Standalone public SDK packaging

## Minimal Workflow

```ts
const meshkit = await Meshkit.init({
  provider: "pinata",
  providerToken: "PINATA_JWT",
});

const saved = await meshkit.store({ hello: "ipfs" });
const loaded = await meshkit.retrieve<{ hello: string }>(saved.cid);
```

## Related APIs

* [init()](/meshkit-documentation/api/init.md)
* [testConnection()](/meshkit-documentation/api/testconnection.md)
* [store()](/meshkit-documentation/api/store.md)
* [retrieve()](/meshkit-documentation/api/retrieve.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bittu-1.gitbook.io/meshkit-documentation/getting-started.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
