Skip to content

Commit

Permalink
Merge branch 'main' into feat/search-drops
Browse files Browse the repository at this point in the history
  • Loading branch information
jm42 authored Apr 8, 2024
2 parents 0a6084b + 9aa1f94 commit 31d718b
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ This is a documentation website for POAP.js, a library for integrating with the

## Getting Started

To get started with this website, you'll need to install its dependencies and start the development server. You can do this using NPM:
To get started with this website, you'll need to install its dependencies and start the development server. You can do this using yarn:

### NPM

```bash
npm install
npm run dev
yarn install
yarn dev
```

Once the development server is running, you can view the website in your web browser by navigating to `http://localhost:3000`.
Expand Down
8 changes: 8 additions & 0 deletions docs/pages/packages/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"poaps": "POAPs",
"drops": "Drops",
"moments": "Moments",
"providers": "Providers",
"frames": "Frames",
"utils": "Utils"
}
90 changes: 90 additions & 0 deletions docs/pages/packages/frames.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# @poap-xyz/frames

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

@poap-xyz/frames is a package to ease the use of [Farcaster Frames](https://docs.farcaster.xyz/learn/what-is-farcaster/frames).

## Features

- Get the list of meta tags to add to an HTML page head
- Build and render the HTML page representing the frame

## Installation

### NPM

```bash
npm install @poap-xyz/frames
```

### Yarn

```bash
yarn add @poap-xyz/frames
```

## Usage

### Get the list of meta tags

```typescript
// pages/index.tsx
import { NextSeo } from 'next-seo';
import { Frame, FrameAspectRatio } from '@poap-xyz/frames';

export default function Component() {
const frame = new Frame({
title: 'Hello Frames!',
image: '<image_url>',
aspectRatio: FrameAspectRatio.SQUARE,
});

return (
<>
<NextSeo
title="Hello Frames!"
description="page description"
openGraph={{ images: [{ url: '<image_url>' }] }}
additionalMetaTags={frame.toMetaTags()}
/>
<div>page content...</div>
</>
)
}
```

### Build and render the HTML page representing the frame

```typescript
// pages/api/frame.ts
import { NextApiRequest, NextApiResponse } from 'next';
import { Frame, FrameAspectRatio } from '@poap-xyz/frames';

export default async function handler(
req: NextApiRequest,
res: NextApiResponse,
) {
const frame = new Frame({
title: 'Hello Frames!',
image: '<image_url>',
aspectRatio: FrameAspectRatio.SQUARE,
});
return res.status(200).send(frame.render());
}
```

## Documentation

For more detailed documentation on POAP topics, please visit [this link](https://documentation.poap.tech/docs).

## Examples

For example scripts and usage, please check the [examples](https://github.com/poap-xyz/poap.js/tree/main/examples).

## Contributing

We welcome contributions! Please see the `CONTRIBUTING.md` file for guidelines.

## License

@poap-xyz/frames is released under the [MIT License](https://opensource.org/licenses/MIT).
2 changes: 1 addition & 1 deletion packages/frames/src/Frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class Frame {
* Generates the meta tags used for the frame.
*
* @example
* const frame = useMemo(() => new Frame({ ... });
* const frame = new Frame({ ... });
* return (
* <>
* <NextSeo
Expand Down

0 comments on commit 31d718b

Please sign in to comment.