You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-34Lines changed: 28 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,16 @@
7
7
</a>
8
8
<br />
9
9
</p>
10
+
<h1align="center">
11
+
Official Clerk JavaScript SDKs
12
+
</h1>
13
+
<palign="center">
14
+
<strong>
15
+
Clerk helps developers build user management. We provide streamlined user experiences for your users to sign up, sign in, and manage their profile.
16
+
</strong>
17
+
</p>
10
18
11
-
# Official Clerk JavaScript SDKs
12
-
13
-
This repository contains all the Clerk JavaScript SDKs under the `@clerk/` namespace. Visit [https://clerk.com](https://clerk.com) to signup for an account.
19
+
This repository contains all the Clerk JavaScript SDKs under the `@clerk` namespace. Visit [clerk.com](https://clerk.com) to signup for an account.
14
20
15
21
[](https://clerk.com/discord)
@@ -24,53 +30,41 @@ Would you like to work on Open Source software and help maintain this repository
24
30
25
31
---
26
32
27
-
## Documentation and Usage
33
+
## 🚀 Get Started with Clerk
28
34
29
-
For how to get started with Clerk, you can refer to the official [documentation page](https://clerk.com/docs).
35
+
1.[Sign up for an account](https://dashboard.clerk.com/sign-up?utm_source=github&utm_medium=clerk_js_repo_readme)
36
+
1. Create an application in your Clerk dashboard
37
+
1. Spin up a new codebase with one of the [quickstart guides](https://clerk.com/docs/quickstarts/overview?utm_source=github&utm_medium=clerk_js_repo_readme)
30
38
31
-
For JavaScript environments/platforms that Clerk supports, there should be a specific package corresponding to the respective technology.
39
+
This repository contains the SDKs for environment/platforms that Clerk supports. For example, if you want to use Clerk with Node.js you can install:
32
40
33
41
```sh
34
42
npm install @clerk/clerk-sdk-node
35
43
# or
36
44
yarn add @clerk/clerk-sdk-node
45
+
# or
46
+
pnpm add @clerk/clerk-sdk-node
37
47
```
38
48
39
-
## Packages
49
+
## 🎓 Learning Clerk
40
50
41
-
For package specific details on installation, architecture and usage usage, you can refer to the package's README file.
51
+
Clerk's full documentation is available at [clerk.com/docs](https://clerk.com/docs?utm_source=github&utm_medium=clerk_js_repo_readme).
42
52
43
-
-[`@clerk/backend`](./packages/backend): Functionalities regarded as "core" for Clerk to operate with. _Authentication resolution, API Resources etc._
44
-
-[`@clerk/clerk-expo`](./packages/expo) Clerk package for the Expo universal app framework.
45
-
-[`@clerk/clerk-js`](./packages/clerk-js): Core JavaScript implementation used by Clerk in the browser.
46
-
-[`@clerk/clerk-react`](./packages/react) Clerk package for React applications.
47
-
-[`@clerk/clerk-sdk-node`](./packages/sdk-node): SDK for native Node.js environment and frameworks.
48
-
-[`@clerk/fastify`](./packages/fastify): Clerk package for Fastify.
49
-
-[`@clerk/chrome-extension`](./packages/chrome-extension): Clerk package for Chrome extensions.
50
-
-[`@clerk/nextjs`](./packages/nextjs): Clerk package for Next.js.
51
-
-[`@clerk/remix`](./packages/remix): Clerk package for Remix.
52
-
-[`@clerk/types`](./packages/types) Main TypeScript typings for Clerk libraries.
53
-
- ...
53
+
-**We recommend starting with the [Quickstart guides](https://clerk.com/docs/quickstarts/overview).** It'll enable you to quickly add Clerk to your application. If you're starting a new project and are not sure what to pick, use [Next.js](https://nextjs.org/docs/getting-started/installation) and [@clerk/nextjs](https://clerk.com/docs/quickstarts/nextjs).
54
+
-**To learn more about Clerk's components and features, checkout the rest of the [Clerk documentation](https://clerk.com/docs?utm_source=github&utm_medium=clerk_js_repo_readme).** You'll be able to e.g. browse the [component reference](https://clerk.com/docs/components/overview?utm_source=github&utm_medium=clerk_js_repo_readme) page.
54
55
55
-
Additionally there are packages which act as shared utilities or building blocks.
56
+
## 🚢 Release Notes
56
57
57
-
## Setup
58
+
Curious what we shipped recently? You can browse the [GitHub Releases](https://github.com/clerkinc/javascript/releases) page or look at the individual `CHANGELOG.md` files inside each package (e.g. [`clerk-js CHANGELOG`](https://github.com/clerkinc/javascript/blob/main/packages/clerk-js/CHANGELOG.md)).
58
59
59
-
- Clone the repository.
60
-
-`npm install`.
61
-
-`npm run build`.
60
+
## 🤝 How to Contribute
62
61
63
-
\* See the [docs folder](./docs) for additional repository documentation.
62
+
We're open to all community contributions! If you'd like to contribute in any way, please read [our contribution guidelines](https://github.com/clerkinc/javascript/blob/main/docs/CONTRIBUTING.md). We'd love to have you as part of the Clerk community!
64
63
65
-
## Cleanup
64
+
It'll show you how to make changes to the SDKs, open pull requests, or submitting issues. If you want to add or edit localizations (e.g. how a button text is translated to your language), you can check out the [`localizations` README](./packages/localizations/README.md).
66
65
67
-
To clean existing builds and installed dependencies of the monorepo and setup again, run `npm run nuke`.
66
+
## 📝 License
68
67
69
-
## How to add a new localization key
68
+
This project is licensed under the **MIT license**.
70
69
71
-
- Add the key types to the types [package](./packages/types/src/localization.ts).
72
-
- Add the corresponding localization values for every supported language in the [localizations package](./packages/localizations/)
73
-
- Replace the plain string (if there is one) with the localization value like so:
Copy file name to clipboardExpand all lines: docs/CONTRIBUTING.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ Please note we have a [code of conduct](https://github.com/clerkinc/javascript/b
18
18
-[What is the difference between a commit message, a PR description and a changeset description?](#what-is-the-difference-between-a-commit-message-a-pr-description-and-a-changeset-description)
19
19
-[Notes on Pull Requests](#notes-on-pull-requests)
20
20
-[Issues and feature requests](#issues-and-feature-requests)
21
+
-[Localizations](#localizations)
21
22
-[Publishing packages](#publishing-packages)
22
23
-[License](#license)
23
24
@@ -35,6 +36,16 @@ The current monorepo setup is based on:
35
36
-[GitHub Actions](https://docs.github.com/en/actions), used for quality checks and automated release orchestration.
36
37
-[Yalc](https://github.com/wclr/yalc), used for to publish packages locally and test them in other local projects.
37
38
39
+
All packages of the monorepo are inside [packages](../packages). For package specific details on installation, architecture and usage, you can refer to the package's README file.
40
+
41
+
-[`@clerk/backend`](../packages/backend): Functionalities regarded as "core" for Clerk to operate with. _Authentication resolution, API Resources etc._
42
+
-[`@clerk/clerk-js`](../packages/clerk-js): Core JavaScript implementation used by Clerk in the browser.
43
+
-[`@clerk/clerk-react`](../packages/react) Clerk package for React applications.
44
+
-[`@clerk/types`](../packages/types): Main TypeScript typings for Clerk libraries.
45
+
- Browse [packages](../packages) to see more
46
+
47
+
Additionally there are packages which act as shared utilities or building blocks.
48
+
38
49
### Prerequisites
39
50
40
51
Have a node version installed that is equal or higher than the one defined in `.nvmrc`
@@ -154,6 +165,10 @@ Issues that have the label `needs-triage` have been seen by our team and are que
154
165
155
166
If you are a paying Clerk customer looking for support, please reach out directly to our support team by heading to https://www.clerk.com, clicking the chat bubble in the bottom right corner, and selecting "contact support".
156
167
168
+
## Localizations
169
+
170
+
If you want to add or edit localizations (e.g. how a button text is translated to your language), you can check out the [`localizations` README](../packages/localizations/README.md).
171
+
157
172
## Publishing packages
158
173
159
174
_Note: Only core maintainers can publish packages._
Copy file name to clipboardExpand all lines: packages/localizations/README.md
+76-9Lines changed: 76 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,9 @@
30
30
31
31
## Overview
32
32
33
-
`@clerk/localizations` contains localized strings for applications using Clerk.
33
+
Clerk offers the ability to override the strings for all of the elements in each of the Clerk Components. This allows you to provide localization for your users or change the wording to suit your brand.
34
+
35
+
`@clerk/localizations` contains localized strings for applications using Clerk. If you found a typo, inaccuracies, or want to contribute a new language, please submit a PR and follow the [contributing guide](#contributing).
34
36
35
37
## Getting Started
36
38
@@ -52,22 +54,43 @@ npm run build
52
54
53
55
## Usage
54
56
57
+
`@clerk/localizations` contains predefined localizations you can use:
socialButtonsBlockButton:'Sign In with {{provider|titleize}}',
83
+
};
84
+
85
+
functionApp() {
60
86
return (
61
-
<ClerkProvider
62
-
localization={frFR}
63
-
{...pageProps}
64
-
>
65
-
<Component {...pageProps} />
87
+
<ClerkProvider localization={localization}>
88
+
<div>Hello from clerk</div>
66
89
</ClerkProvider>
67
90
);
68
91
}
69
92
70
-
exportdefaultMyApp;
93
+
exportdefaultApp;
71
94
```
72
95
73
96
## Support
@@ -82,6 +105,50 @@ You can get in touch with us in any of the following ways:
82
105
83
106
We're open to all community contributions! If you'd like to contribute in any way, please read [our contribution guidelines](https://github.com/clerkinc/javascript/blob/main/docs/CONTRIBUTING.md).
84
107
108
+
### Adding a new localization key
109
+
110
+
1. Open the [`types/src/localization.ts`](https://github.com/clerkinc/javascript/blob/main/packages/types/src/localization.ts) file to add a new key to the `_LocalizationResource` type.
111
+
112
+
Naming things is hard, so try these things first: Has the component that should contain the new key already other localizations? If yes, see how they are named and if you could follow that pattern. For example, the `<SignIn />` component has keys with `signIn.start.title`, then I'd make sense to follow the `signIn.` pattern. If you're not sure, take your best guess and the maintainers will comment on the PR!
113
+
114
+
An exception to that are any errors that might be returned from the Frontend API. They need to go into the `unstable__errors` object inside each localization.
115
+
116
+
1. Run `npm build` to compile `types` with your new key
117
+
118
+
1. Open the [`localizations/src/en-US.ts`](https://github.com/clerkinc/javascript/blob/main/packages/localizations/src/en-US.ts) file and add your new key to the object. `en-US` is the default language. If you feel comfortable adding your message in another language than English, feel free to also edit other files.
119
+
120
+
1. Use the new localization key inside the component. There are two ways:
You'll need to import `localizationKeys` and `useLocalizations` when using them.
139
+
140
+
### Updating a localization key
141
+
142
+
1. Open the [`localizations/src/en-US.ts`](https://github.com/clerkinc/javascript/blob/main/packages/localizations/src/en-US.ts) file and search for the text you want to update.
143
+
144
+
1. Update the text inside `en-US`. If possible, also update other languages.
145
+
146
+
### Adding a new localization language
147
+
148
+
1. Create a new file that follows the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format
149
+
150
+
1. Copy the contents of the `en-US.ts` file and translate all keys where necessary. Empty strings can stay empty. You don't need to translate things word by word, adjust where necessary as long as the same meaning is conveyed.
151
+
85
152
## Security
86
153
87
154
`@clerk/localizations` follows good practices of security, but 100% security cannot be assured.
0 commit comments