npm i instagram-deeplink
- Add this middleware:
app.use('/insta', instagramDeeplink);
- Chill 😎.
You can skip first argument to make middleware work from root path
Content type | User visits | iOS | Others |
---|---|---|---|
Profile | https://your_host.com/insta/username | instagram:https://user?username=username | https://instagram.com/username |
Post | https://your_host.com/insta/p/B6f78z7jr42/ | instagram:https://media?id=B6f78z7jr42 | https://instagram.com/p/B6f78z7jr42/ |
Hashtag | https://your_host.com/insta/explore/tags/js/ | instagram:https://tag?name=js | https://instagram.com/explore/tags/js/ |
Location | https://your_host.com/insta/explore/locations/213174824/ | instagram:https://location?id=213174824 | https://instagram.com/explore/locations/213174824/ |
Simple example is provided in /service
folder.
import * as express from 'express';
import { instagramDeeplink } from 'instagram-deeplink';
const app = express();
app.use('/insta', instagramDeeplink);
app.listen(3000, function () {
console.log('Try to visit https://<your_ip>:3000/insta/username from your iOS device to open @username instagram profile directly in the app');
});