A 5-Year-Old Could Follow This TypeScript SDK Development Guide ~ Part 5: CDN for Browsers

This is Part 5 of our SDK development series where we get a CDN of our SDK


This content originally appeared on HackerNoon and was authored by Syed Muhammad Yaseen

Helloooooooo!

\ Hope you're doing great! This is SMY! 👋 Let's jump right in 🚀

\ This is Part 5 of our SDK development series where we get a CDN of our SDK

Contents:

  • ⚡ Getting CDN
  • ⚡ Integrating CDN and testing SDK

Step 1: Get a CDN

Head over to https://www.jsdelivr.com/, and search for your NPM package.

\ Choose the default version, and copy the link.

\ Head over to the Test Browser app, and integrate the CDN:

\

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/ts-lib-template-starter@1.0.0/dist/index.global.min.js"></script>
  </head>
  <body>
    This is a Test HTML

    <script>
      sdk.fetchUsers().then((users) => console.log(users));
    </script>
  </body>
</html>

\ Open the file, and see the result:

\

Step 2: Getting the Latest CDN Version Always

Put @latest instead of the version to always fetch the latest CDN version

\ https://cdn.jsdelivr.net/npm/ts-lib-template-starter@latest/dist/index.global.min.js

\ Sometimes, when a new version of SDK is published, jsDeliver takes a few minutes to a few days to point @latest version to the updated version.

\ To fix this, when you publish a new version, head over to https://www.jsdelivr.com/tools/purge, and enter the link of the CDN like:

\

This will purge the cache and point @latest version to the updated version.

Wrapping Up:

We just completed the steps to get a CDN of our SDK.

\ Stay tuned for further parts to dive deep into SDK development, and explore features like Web Push Notifications, Service Workers, etc. 🚀

…..

Now, you're equipped with the knowledge to publish your own SDK. Happy coding! 🚀

\ That's it, folks!

\ Hope it was a good read for you. Thank you! ✨

\ 👉 Follow me

GitHub

LinkedIn


This content originally appeared on HackerNoon and was authored by Syed Muhammad Yaseen


Print Share Comment Cite Upload Translate Updates
APA

Syed Muhammad Yaseen | Sciencx (2024-07-08T21:27:55+00:00) A 5-Year-Old Could Follow This TypeScript SDK Development Guide ~ Part 5: CDN for Browsers. Retrieved from https://www.scien.cx/2024/07/08/a-5-year-old-could-follow-this-typescript-sdk-development-guide-part-5-cdn-for-browsers/

MLA
" » A 5-Year-Old Could Follow This TypeScript SDK Development Guide ~ Part 5: CDN for Browsers." Syed Muhammad Yaseen | Sciencx - Monday July 8, 2024, https://www.scien.cx/2024/07/08/a-5-year-old-could-follow-this-typescript-sdk-development-guide-part-5-cdn-for-browsers/
HARVARD
Syed Muhammad Yaseen | Sciencx Monday July 8, 2024 » A 5-Year-Old Could Follow This TypeScript SDK Development Guide ~ Part 5: CDN for Browsers., viewed ,<https://www.scien.cx/2024/07/08/a-5-year-old-could-follow-this-typescript-sdk-development-guide-part-5-cdn-for-browsers/>
VANCOUVER
Syed Muhammad Yaseen | Sciencx - » A 5-Year-Old Could Follow This TypeScript SDK Development Guide ~ Part 5: CDN for Browsers. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/08/a-5-year-old-could-follow-this-typescript-sdk-development-guide-part-5-cdn-for-browsers/
CHICAGO
" » A 5-Year-Old Could Follow This TypeScript SDK Development Guide ~ Part 5: CDN for Browsers." Syed Muhammad Yaseen | Sciencx - Accessed . https://www.scien.cx/2024/07/08/a-5-year-old-could-follow-this-typescript-sdk-development-guide-part-5-cdn-for-browsers/
IEEE
" » A 5-Year-Old Could Follow This TypeScript SDK Development Guide ~ Part 5: CDN for Browsers." Syed Muhammad Yaseen | Sciencx [Online]. Available: https://www.scien.cx/2024/07/08/a-5-year-old-could-follow-this-typescript-sdk-development-guide-part-5-cdn-for-browsers/. [Accessed: ]
rf:citation
» A 5-Year-Old Could Follow This TypeScript SDK Development Guide ~ Part 5: CDN for Browsers | Syed Muhammad Yaseen | Sciencx | https://www.scien.cx/2024/07/08/a-5-year-old-could-follow-this-typescript-sdk-development-guide-part-5-cdn-for-browsers/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.