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

@adwhale/web-sdk

v0.0.1

Published

ADwhale Ad Mediation Web SDK

Readme

@adwhale/web-sdk

ADwhale 광고 미디에이션 Web SDK. 배너, 전면(Interstitial), 네이티브 광고를 웹에서 워터폴 미디에이션 방식으로 제공합니다.

설치

npm install @adwhale/web-sdk

프레임워크별 래퍼도 제공됩니다:

  • React: npm install @adwhale/web-sdk-react
  • Vue 3: npm install @adwhale/web-sdk-vue
  • Angular: npm install @adwhale/web-sdk-angular
  • AngularJS: npm install @adwhale/web-sdk-angularjs

CDN 사용

<script src="https://cdn.fsn.co.kr/sdk/adwhale/adwhale.sdk.min.js"></script>
<script>
  adwhale.cmd.push(function() {
    adwhale.AdWhaleMediationAds.init({ publisherUid: 'PUB-XXXX' });
  });
</script>

빠른 시작

1. SDK 초기화

import { AdWhaleMediationAds } from '@adwhale/web-sdk';

AdWhaleMediationAds.init({
  publisherUid: 'PUB-XXXX',
  debug: true,       // 콘솔 로그 출력
  testMode: false,   // 테스트 광고 모드
});

2. 배너 광고

const banner = AdWhaleMediationAds.createBanner({
  placementUid: 'PLACE-XXXX',
  container: '#ad-banner',    // CSS 셀렉터 또는 HTMLElement
  adSize: '320x50',
  autoRefresh: true,
  loading: 'lazy',
  passbackTag: '<div>fallback ad</div>',
});

banner
  .onAdLoaded((info) => console.log('loaded', info))
  .onAdLoadFailed((error) => console.log('failed', error))
  .onAdImpression((info) => console.log('impression', info))
  .onAdClicked(() => console.log('clicked'))
  .onAdRefreshed((info) => console.log('refreshed', info))
  .onPassback(() => console.log('passback'))
  .load();

// 정리
banner.destroy();

3. 전면 광고 (Interstitial)

const interstitial = AdWhaleMediationAds.createInterstitial({
  placementUid: 'PLACE-YYYY',
});

interstitial
  .onAdLoaded((info) => console.log('ready', info))
  .onAdLoadFailed((error) => console.log('failed', error))
  .onAdShowed(() => console.log('showed'))
  .onAdImpression((info) => console.log('impression', info))
  .onAdClosed(() => console.log('closed'))
  .onAdClicked(() => console.log('clicked'))
  .load();

// 로드 완료 후 표시
interstitial.show();

// 정리
interstitial.destroy();

4. 네이티브 광고

const native = AdWhaleMediationAds.createNative({
  placementUid: 'PLACE-ZZZZ',
  container: '#native-ad',
  loading: 'lazy',
});

native
  .onAdLoaded((info) => {
    const data = native.adData;
    // data.title, data.desc, data.imageMain, data.imageIcon,
    // data.linkUrl, data.ctaText, data.sponsored
  })
  .onAdLoadFailed((error) => console.log('failed', error))
  .onAdImpression((info) => console.log('impression', info))
  .onAdClicked(() => console.log('clicked'))
  .load();

5. <ins> 태그 선언적 방식

HTML에 <ins> 태그를 추가하면 SDK가 자동으로 배너 광고를 생성합니다.

<ins class="adwhale-ad"
  data-placement-uid="PLACE-XXXX"
  data-ad-size="320x50"
  data-loading="lazy"
></ins>

SPA에서 동적으로 추가되는 <ins> 태그도 MutationObserver로 자동 감지합니다.

Ad Blocker 감지

AdWhaleMediationAds.onAdBlocked(() => {
  console.log('Ad blocker detected');
});

// 또는 직접 확인
if (AdWhaleMediationAds.isAdBlockerDetected()) {
  // ...
}

API

AdWhaleMediationAds

| 메서드 | 설명 | |--------|------| | init(config) | SDK 초기화 (최초 1회) | | reset() | SDK 상태 리셋 (재초기화 시 필요) | | isInitialized() | 초기화 여부 | | createBanner(options) | 배너 광고 인스턴스 생성 | | createInterstitial(options) | 전면 광고 인스턴스 생성 | | createNative(options) | 네이티브 광고 인스턴스 생성 | | onAdBlocked(cb) | Ad blocker 감지 콜백 | | isAdBlockerDetected() | Ad blocker 감지 여부 |

AdWhaleInitConfig

| 필드 | 타입 | 필수 | 설명 | |------|------|------|------| | publisherUid | string | O | 매체 UID | | debug | boolean | | 디버그 로그 (기본: false) | | testMode | boolean | | 테스트 모드 (기본: false) | | environment | "real" \| "uat" | | 환경 (기본: "real") | | coreSdkUrl | string | | Core SDK CDN URL (커스텀) |

BannerOptions

| 필드 | 타입 | 필수 | 설명 | |------|------|------|------| | placementUid | string | O | 지면 UID | | container | string \| HTMLElement | O | 광고 컨테이너 | | adSize | "320x50" \| "320x100" \| "300x250" \| "250x250" \| "adaptive" | | 광고 사이즈 | | autoRefresh | boolean | | 자동 갱신 | | loading | "lazy" \| "eager" | | 로딩 방식 (기본: "lazy") | | passbackTag | string | | Passback HTML |

InterstitialOptions

| 필드 | 타입 | 필수 | 설명 | |------|------|------|------| | placementUid | string | O | 지면 UID | | passbackTag | string | | Passback HTML |

NativeOptions

| 필드 | 타입 | 필수 | 설명 | |------|------|------|------| | placementUid | string | O | 지면 UID | | container | string \| HTMLElement | O | 광고 컨테이너 | | loading | "lazy" \| "eager" | | 로딩 방식 | | passbackTag | string | | Passback HTML |

라이선스

MIT