npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aslna-sdk

v1.0.1

Published

Supabase SDK query patterns for Aslna frontend

Readme

aslna-sdk

Supabase SDK query patterns for the Aslna frontend — an Algerian cultural heritage platform.

Installation

npm install aslna-sdk

Setup

import { getSupabaseClient } from 'aslna-sdk'

const supabase = getSupabaseClient(
  process.env.SUPABASE_URL,
  process.env.SUPABASE_ANON_KEY
)

Available Functions

Memories

import { getMemoryPins, submitMemory } from 'aslna-sdk'

// Load approved memory pins for the map
const pins = await getMemoryPins(supabase)

// Filter by pin type: 'artisan' | 'story' | 'music' | 'craft'
const artisanPins = await getMemoryPins(supabase, 'artisan')

// Submit a new memory with media files
const memory = await submitMemory(supabase, {
  pin_type: 'artisan',
  reporter_id: user.id,
  subject_name: 'Ahmed',
  subject_age: 72,
  subject_origin_id: 'wilaya-uuid',
  domain: 'music',
  description_paragraph: '...',
  coordinates: { lat: 36.7, lng: 3.0 }
}, mediaFiles)

Posts

import { submitPost, getCommunityFeed } from 'aslna-sdk'

// Get community feed (60/40 rotation)
const posts = await getCommunityFeed(supabase, user.id)

// Submit a post with media
const post = await submitPost(supabase, {
  author_id: user.id,
  content_text: '...',
  wilaya_id: 'wilaya-uuid'
}, mediaFiles)

Dashboard

import { getRarestWilayas, getDyingTraditions } from 'aslna-sdk'

const wilayas = await getRarestWilayas(supabase)
const traditions = await getDyingTraditions(supabase)

Profile

import { getUserHistory, getSavedMemories, getArtisanProfile } from 'aslna-sdk'

const history = await getUserHistory(supabase, user.id)
const saved = await getSavedMemories(supabase, user.id)
const profile = await getArtisanProfile(supabase, user.id)

Games

import { getGames, getUserGameProgress, updateGameLevel } from 'aslna-sdk'

const games = await getGames(supabase)
const progress = await getUserGameProgress(supabase, user.id)
await updateGameLevel(supabase, user.id, gameId, newLevel)

Cultural Test

import { runCulturalTest, saveRecommendedInterests } from 'aslna-sdk'

const test = await runCulturalTest(supabase, user.id)
// test.questions → render quiz UI
await saveRecommendedInterests(supabase, user.id, test.recommended_interests)

Spotify Diagnosis

import { runSpotifyDiagnosis, getSpotifyDiagnosis } from 'aslna-sdk'

// Call after OAuth redirect
const diagnosis = await runSpotifyDiagnosis(supabase, user.id, spotifyCode)
// diagnosis.algerian_ratio, diagnosis.missing_wilaya_ids, diagnosis.buried_content

// Fetch stored diagnosis
const stored = await getSpotifyDiagnosis(supabase, user.id)

Admin

import { getModerationQueue, approveMemory, approvePost, getRarityHistory } from 'aslna-sdk'

const queue = await getModerationQueue(supabase)
await approveMemory(supabase, memoryId)
await approvePost(supabase, postId)
const history = await getRarityHistory(supabase)