Skip to content
Open
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist
node_modules
node_modules
.idea
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ const options = {
};

const imgUrl = urlbox.generateRenderLink(options);
// https://api.urlbox.io/v1/YOUR_API_KEY/TOKEN/jpg?url=github.com&thumb_width=600&quality=80
// https://api.urlbox.com/v1/YOUR_API_KEY/TOKEN/jpg?url=github.com&thumb_width=600&quality=80
```

Now stick that url in an img tag to render the screenshot!

![Urlbox Screenshot of github.com](https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/5a9a56f05cf1229bd8f2edf4a0e6c218ccea1bb7/jpeg?url=github.com&thumb_width=600&quality=80)
![Urlbox Screenshot of github.com](https://api.urlbox.com/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/5a9a56f05cf1229bd8f2edf4a0e6c218ccea1bb7/jpeg?url=github.com&thumb_width=600&quality=80)

Available options:

Expand Down
8 changes: 4 additions & 4 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { RenderOptions } from "types";

const myapikey = "MY_API_KEY";
const mysecret = "secret";
const prefix = "https://api.urlbox.io/v1/";
const prefix = "https://api.urlbox.com/v1/";
const urlbox = urlboxFactory(myapikey, mysecret);

const toQuery = (options: RenderOptions) =>
Expand All @@ -29,7 +29,7 @@ test("should return a url with a valid token and query string", () => {
.update(query)
.digest("hex");
expect(renderLink).toEqual(
"https://api.urlbox.io/v1/" + myapikey + "/" + token + "/png?" + query
"https://api.urlbox.com/v1/" + myapikey + "/" + token + "/png?" + query
);
});
test("should return a url with a valid token and query string with width param", () => {
Expand Down Expand Up @@ -169,7 +169,7 @@ test("removes false values from query", () => {
.digest("hex");

expect(renderLink).toEqual(
"https://api.urlbox.io/v1/" + myapikey + "/" + token + "/png?" + query
"https://api.urlbox.com/v1/" + myapikey + "/" + token + "/png?" + query
);
});
test("removes 0 values from query", () => {
Expand All @@ -188,7 +188,7 @@ test("removes 0 values from query", () => {
.digest("hex");

expect(renderLink).toEqual(
"https://api.urlbox.io/v1/" + myapikey + "/" + token + "/png?" + query
"https://api.urlbox.com/v1/" + myapikey + "/" + token + "/png?" + query
);
});
test("kitchen sink", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import qs from "qs";
import { createHmac } from "node:crypto";
import { RenderOptions } from "./types";

const DEFAULT_PREFIX = "https://api.urlbox.io/v1/";
const DEFAULT_PREFIX = "https://api.urlbox.com/v1/";
const DEFAULT_OPTIONS = {
format: "png",
};
Expand Down
Loading