Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .changeset/five-fishes-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
"@clerk/chrome-extension": patch
"@clerk/tanstack-start": patch
"@clerk/localizations": patch
"@clerk/clerk-js": patch
"@clerk/elements": patch
"@clerk/clerk-sdk-node": patch
"@clerk/backend": patch
"@clerk/express": patch
"@clerk/fastify": patch
"@clerk/testing": patch
"@clerk/upgrade": patch
"@clerk/nextjs": patch
"@clerk/themes": patch
"@clerk/astro": patch
"@clerk/clerk-react": patch
"@clerk/remix": patch
"@clerk/types": patch
"@clerk/clerk-expo": patch
---

Tidy up and improve README
4 changes: 3 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ To set up your development environment, please follow these steps:

This ensures that all internal TypeScript types are generated and any dependencies between packages are resolving.

For package specific setup, refer to the `Build` section of the specific package (e.g. `packages/<package_name>/README.md#build`).
Once you're ready to make changes, run `npm run dev` from the monorepo root.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I removed the "Build" instructions from the READMEs I made this addition


If you want to run the `dev` script of an individual package, navigate to the folder and run the script from there. This way you can also individually run the `build` script.

### Documenting your changes

Expand Down
139 changes: 10 additions & 129 deletions packages/astro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
</picture>
</a>
<br />
<h1 align="center">@clerk/astro</h1>
</p>

# @clerk/astro

<div align="center">

[![Chat on Discord](https://img.shields.io/discord/856971667393609759.svg?logo=discord)](https://clerk.com/discord)
Expand All @@ -22,164 +21,46 @@
·
[Request a Feature](https://feedback.clerk.com/roadmap)
·
[Ask a Question](https://github.com/clerk/javascript/discussions)
[Get help](https://clerk.com/contact/support?utm_source=github&utm_medium=clerk_astro)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We disabled Github Discussions so no use to link to that


</div>

---

## Overview

Clerk is the easiest way to add authentication and user management to your Astro application. Add sign up, sign in, and profile management to your Astro application in minutes.

## Getting Started
[Clerk](https://clerk.com/?utm_source=github&utm_medium=clerk_astro) is the easiest way to add authentication and user management to your Astro application. Add sign up, sign in, and profile management to your application in minutes.

### Prerequisites

- Astro 3.2 or later
- Node.js `>=18.17.0` or later
- An existing Clerk application. [Create your account for free](https://dashboard.clerk.com/sign-up?utm_source=github&utm_medium=clerk_astro).

### Installation

Add `@clerk/astro` as a dependency

**With npm**

```sh
npm install @clerk/astro
```

**With yarn**

```sh
yarn add @clerk/astro
```

**With pnpm**

```sh
pnpm add @clerk/astro
```

### Build

To build the package locally with the TypeScript compiler, run:

```sh
npm run build
```

To build the package in watch mode, run the following:
The fastest way to get started with Clerk is by following the [Astro Quickstart](https://clerk.com/docs/quickstarts/astro?utm_source=github&utm_medium=clerk_astro).

```sh
npm run dev
```
You'll learn how to install `@clerk/astro`, set up your environment keys, add the `clerk()` integration to your application, use the Clerk middleware, and use Clerk's prebuilt components.

## Usage

### Set environment variables

```sh
PUBLIC_CLERK_PUBLISHABLE_KEY=pk_(test|live)_xxxxxxx
CLERK_SECRET_KEY=sk_(test|live)_xxxxxxx

PUBLIC_CLERK_SIGN_IN_URL=/sign-in # update this if sign in page exists on another path
PUBLIC_CLERK_SIGN_UP_URL=/sign-up # update this if sign up page exists on another path
```

### Update `env.d.ts`

```ts
/// <reference types="astro/client" />
/// <reference types="@clerk/astro/env" />
```

### Add integrations

Follow [the instructions](https://clerk.com/docs/quickstarts/astro) in our documentation.

Example configuration file

```js
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';
import clerk from '@clerk/astro';

export default defineConfig({
integrations: [clerk()],
adapter: node({ mode: 'standalone' }),
output: 'server',
});
```

### Add a middleware file

This step is required in order to use SSR or any control component. Create a `middleware.ts` file inside the `src/` directory.

```ts
import { clerkMiddleware } from '@clerk/astro/server';

export const onRequest = clerkMiddleware();
```

### Use components inside .astro files

```astro
---
import { SignedIn, SignedOut, UserButton, SignInButton } from "@clerk/astro/components";
---
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
</head>
<body>
<header>
<h1>{title}</h1>
<nav>
<SignedOut>
<SignInButton mode="modal" />
</SignedOut>
<SignedIn>
<UserButton />
</SignedIn>
</nav>
</header>
<article>
<slot />
</article>
</body>
</html>
```

_For further details and examples, please refer to
our [Documentation](https://clerk.com/docs?utm_source=github&utm_medium=clerk_nextjs)._
For further information, guides, and examples visit the [Astro reference documentation](https://clerk.com/docs/references/astro/overview?utm_source=github&utm_medium=clerk_astro).

## Support

You can get in touch with us in any of the following ways:

- Join our official community [Discord server](https://clerk.com/discord)
- Create a [GitHub Discussion](https://github.com/clerk/javascript/discussions)
- Contact options listed on [our Support page](https://clerk.com/support?utm_source=github&utm_medium=clerk_astro)
- On [our support page](https://clerk.com/contact/support?utm_source=github&utm_medium=clerk_astro)

## Contributing

We're open to all community contributions! If you'd like to contribute in any way, please
read [our contribution guidelines](https://github.com/clerk/javascript/blob/main/docs/CONTRIBUTING.md))
.
We're open to all community contributions! If you'd like to contribute in any way, please read [our contribution guidelines](https://github.com/clerk/javascript/blob/main/docs/CONTRIBUTING.md) and [code of conduct](https://github.com/clerk/javascript/blob/main/docs/CODE_OF_CONDUCT.md).

## Security

`@clerk/astro` follows good practices of security, but 100% security cannot be assured.

`@clerk/astro` is provided **"as is"** without any **warranty**. Use at your own risk.

_For more information and to report security issues, please refer to
our [security documentation](https://github.com/clerk/javascript/blob/main/docs/SECURITY.md)._
_For more information and to report security issues, please refer to our [security documentation](https://github.com/clerk/javascript/blob/main/docs/SECURITY.md)._

## License

Expand Down
Loading