Get started with instagram-lite CDN
MIT licensed
The Instagram-lite library is a minimal solution for implementing Instagram-like features, such as image filtering and uploading.
Tags:- photos
- api
- feed
Stable version
Copied!
How to start using instagram-lite CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with instagram-lite CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="https://cdn.cdnhub.io/instagram-lite/3.0.0/instagramlite.min.js"></script>
<style>
#instagram-container {
width: 100%;
height: 500px;
border: 1px solid #ccc;
}
</style>
</head>
<body>
<div id="instagram-container"></div>
<script>
async function initInstagram() {
const accessToken = 'YOUR_ACCESS_TOKEN'; // Replace with your access token
const client = new window.Instagram.Client();
await client.init('YOUR_APP_ID'); // Replace with your app ID
await client.login(accessToken);
const feed = new client.Feed('recent');
feed.on('load', function() {
const container = document.getElementById('instagram-container');
container.innerHTML = '';
feed.map(function(item) {
const img = document.createElement('img');
img.src = item.images.standard_resolution.url;
img.alt = item.caption.text;
container.appendChild(img);
});
});
feed.load();
}
initInstagram();
</script>
</body>
</html>
Copied!
Copied!