Skip to content

Commit d81b62c

Browse files
committed
Improve instagram client defaults
The default values and documentation of the instagram client have been improved.
1 parent cee2d68 commit d81b62c

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/index.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,27 +124,24 @@ class InstagramClient extends Client {
124124
*
125125
* @constructor
126126
* @author Nico Schett <contact@schett.net>
127-
* @param url The base URL the GithubClient should be working on.
128-
* Default: "https://api.github.com/graphql".
127+
* @param url The base URL the InstagramClient should be working on.
128+
* Default: "https://graph.instagram.com"
129129
* @param headers A object containing various request headers
130130
* @param type A type description to differ between multiple instances
131131
*/
132132
constructor(
133-
url: string = "https://api.github.com/graphql",
134-
headers: { accessToken: string },
133+
accessToken: string,
134+
url: string = "https://graph.instagram.com",
135+
headers: {} = {},
135136
type: string = "scraper"
136137
) {
137138
super({ type, url, headers });
138139

139-
this.ep = new Scraper("https://graph.instagram.com", {
140-
headers: { Authorization: `Bearer ${headers.accessToken}` },
140+
this.ep = new Scraper(url, {
141+
headers: { Authorization: `Bearer ${accessToken}` },
141142
});
142143

143-
this.session = new InstagramSession(
144-
"instagram",
145-
headers.accessToken,
146-
this.ep
147-
);
144+
this.session = new InstagramSession("instagram", accessToken, this.ep);
148145
}
149146
}
150147

0 commit comments

Comments
 (0)