Skip to content

Commit 608ba0a

Browse files
author
Rajat
committed
Removed irrevelant developer docs
1 parent c0488ec commit 608ba0a

6 files changed

Lines changed: 8 additions & 158 deletions

File tree

apps/docs-new/content/docs/developers/introduction.mdx

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to integrate with your CourseLit school using the API
55

66
## Introduction
77

8-
CourseLit provides a powerful API that allows you to manage your school programmatically. This guide will help you understand how to integrate with the CourseLit API.
8+
CourseLit provides an API that allows you to manage your school programmatically. Start here to understand how to authenticate and prepare your integration.
99

1010
You can also explore the interactive [API Reference](/api-reference).
1111

@@ -22,68 +22,13 @@ To interact with the CourseLit API, you need an API key. Follow these steps to o
2222

2323
1. Log in to your CourseLit admin account.
2424
2. Navigate to the dashboard.
25-
3. Go to the `Settings > API Keys` section and generate a new API key.
25+
3. Go to the `Settings > Miscellaneous > API Keys` section and generate a new API key.
2626

2727
## Setting Up the Environment
2828

29-
You need to set up your environment variables to store your CourseLit server URL and API key securely. Here is an example of how to do it in JavaScript:
29+
Store your CourseLit server URL and API key securely in environment variables used by your application.
3030

31-
```javascript
32-
const courselitServer = process.env.COURSELIT_SERVER;
33-
const courselitApikey = process.env.COURSELIT_APIKEY;
34-
35-
export async function createUser({ email }) {
36-
if (!courselitServer || !courselitApikey) {
37-
return;
38-
}
39-
40-
const endPoint = `${courselitServer}/api/user`;
41-
42-
const response = await fetch(endPoint, {
43-
method: "POST",
44-
headers: {
45-
"content-type": "application/json",
46-
},
47-
body: JSON.stringify({
48-
email,
49-
apikey: courselitApikey,
50-
}),
51-
});
52-
53-
let responseBody = await response.json();
54-
55-
if (response.ok && !responseBody.error) {
56-
return response;
57-
} else {
58-
throw new Error(
59-
`${responseBody.error}, ${response.status}, ${response.statusText}, ${endPoint}`,
60-
);
61-
}
62-
}
63-
```
64-
65-
### Explanation
66-
67-
1. **courselitServer**: This should be set to your CourseLit school's URL.
68-
2. **courselitApikey**: This should be set to the API key you generated from the dashboard.
69-
70-
## Example Usage
71-
72-
Here is an example of how to use the `createUser` function:
73-
74-
```javascript
75-
import { createUser } from "./path-to-your-function";
76-
77-
const email = "user@example.com";
78-
79-
createUser({ email })
80-
.then((response) => {
81-
console.log("User created successfully:", response);
82-
})
83-
.catch((error) => {
84-
console.error("Error creating user:", error);
85-
});
86-
```
31+
For endpoint details, request and response schemas, and example requests, use the [API Reference](/api-reference).
8732

8833
## Need Help?
8934

apps/docs-new/content/docs/developers/manage-users.mdx

Lines changed: 0 additions & 95 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"title": "Developers",
33
"icon": "Code",
4-
"pages": ["introduction", "manage-users"]
4+
"pages": ["introduction"]
55
}

apps/docs-new/content/docs/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"blog",
1212
"schools",
1313
"users",
14-
"developers",
1514
"self-hosting",
15+
"developers",
1616
"api-reference"
1717
]
1818
}

apps/docs-new/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/dev/types/routes.d.ts";
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/docs/src/pages/en/developers/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To interact with the CourseLit API, you need an API key. Follow these steps to o
2121

2222
1. Log in to your CourseLit admin account.
2323
2. Navigate to the dashboard.
24-
3. Go to the `Settings > API Keys` section and generate a new API key.
24+
3. Go to the `Settings > Miscellaneous > API Keys` section and generate a new API key.
2525

2626
## Setting Up the Environment
2727

0 commit comments

Comments
 (0)