Skip to content

Commit d827fbd

Browse files
committed
docs: 📝 Updates README
1 parent e9029ac commit d827fbd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Install it via npm:
1919
npm i @contentstack/management
2020
```
2121
To import the SDK, use the following command:
22-
```
22+
```javascript
2323
import contentstack from ‘@contentstack/management’
2424

2525
contentstackClient = contentstack.client()
@@ -29,12 +29,12 @@ contentstackClient = contentstack.client()
2929
To use this SDK, you need to authenticate your users by using the Authtoken, credentials, or Management Token (stack-level token).
3030
### Authtoken
3131
An [Authtoken](https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens/#authentication-tokens-authtokens-) is a read-write token used to make authorized CMA requests, and it is a **user-specific** token.
32-
```
32+
```javascript
3333
contentstackClient = contentstack.client({ authtoken: 'AUTHTOKEN' })
3434
```
3535
### Login
3636
To Login to Contentstack by using credentials, you can use the following lines of code:
37-
```
37+
```javascript
3838
contentstackClient.login({ email: 'EMAIL', password: 'PASSWORD'})
3939
.then((response) => {
4040
console.log(response.notice)
@@ -44,7 +44,7 @@ contentstackClient.login({ email: 'EMAIL', password: 'PASSWORD'})
4444

4545
### Management Token
4646
[Management Tokens](https://www.contentstack.com/docs/developers/create-tokens/about-management-tokens/) are **stack-level** tokens, with no users attached to them.
47-
```
47+
```javascript
4848
contentstackClient.stack({ api_key: 'API_KEY', management_token: 'MANAGEMENT_TOKEN' }).contentType('CONTENT_TYPE_UID')
4949
.fetch()
5050
.then((contenttype) => {
@@ -54,14 +54,14 @@ contentstackClient.stack({ api_key: 'API_KEY', management_token: 'MANAGEMENT_TOK
5454
### Contentstack Management JavaScript SDK: 5-minute Quickstart
5555
#### Initializing Your SDK:
5656
To use the JavaScript CMA SDK, you need to first initialize it. To do this, use the following code:
57-
```
57+
```javascript
5858
import contentstack from ‘@contentstack/management’
5959

6060
var contentstackClient = contentstack.client({ authtoken: 'AUTHTOKEN' })
6161
```
6262
#### Fetch Stack Detail
6363
Use the following lines of code to fetch your stack detail using this SDK:
64-
```
64+
```javascript
6565
contentstackClient.stack({ api_key: 'API_KEY' })
6666
.fetch()
6767
.then((stack) => {
@@ -71,7 +71,7 @@ contentstackClient.stack({ api_key: 'API_KEY' })
7171

7272
#### Create Entry
7373
To create an entry in a specific content type of a stack, use the following lines of code:
74-
```
74+
```javascript
7575
var entry = {
7676
title: 'Sample Entry',
7777
url: '/sampleEntry'
@@ -85,7 +85,7 @@ contentstackClient.stack({ api_key: 'API_KEY' }).contentType('CONTENT_TYPE_UID')
8585

8686
#### Create Asset
8787
The following lines of code can be used to upload assets to your stack:
88-
```
88+
```javascript
8989
var asset = {
9090
upload: 'path/to/file',
9191
title: 'Asset Title'
@@ -104,7 +104,7 @@ contentstackClient.stack({ api_key: 'API_KEY' }).asset().create({ asset })
104104
- [Content Management API Docs](https://www.contentstack.com/docs/developers/apis/content-management-api)
105105

106106
### The MIT License (MIT)
107-
Copyright © 2012-2022 [Contentstack](https://www.contentstack.com/). All Rights Reserved
107+
Copyright © 2012-2023 [Contentstack](https://www.contentstack.com/). All Rights Reserved
108108

109109
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
110110

0 commit comments

Comments
 (0)