
Security News
PHP Foundation Says Chainguard Broke Security Embargo Ahead of Emergency Patches
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.
shenshi-h5
Advanced tools
ShenshiH5 广告 SDK 是专为移动端 H5 应用设计的轻量级广告集成解决方案,支持原生广告和插屏广告,提供简洁高效的 API 接口。
hasAd() 函数,智能判断广告可用性npm install shenshi-h5
在应用入口处初始化一次:
import { init } from 'shenshi-h5'
await init({
nativeAdvKeys: ['YOUR_NATIVE_AD_KEY'],
interstitialAdvKeys: ['YOUR_INTERSTITIAL_AD_KEY']
})
import { hasAd, renderNative } from 'shenshi-h5'
// 检查广告是否可用
if (hasAd('YOUR_NATIVE_AD_KEY')) {
renderNative({
adv_key: 'YOUR_NATIVE_AD_KEY',
containerId: 'ad-container',
callback: (result) => console.log(result)
})
}
init(options)初始化广告 SDK。
参数:
nativeAdvKeys (string[]): 原生广告位 key 数组interstitialAdvKeys (string[]): 插屏广告位 key 数组返回值:
Promise<void>hasAd(adv_key)检查指定广告是否可用。
参数:
adv_key (string): 广告位 key返回值:
boolean: 广告是否可用renderNative(options)渲染原生广告。
参数:
adv_key (string): 广告位 keycontainerId (string): 容器元素 IDcallback (function): 渲染结果回调函数renderInterstitial(adv_key, callback)渲染插屏广告。
参数:
adv_key (string): 广告位 keycallback (function): 渲染结果回调函数<template>
<div>
<div v-if="hasAd('AD_KEY')">
<div id="ad-container"></div>
</div>
</div>
</template>
<script setup>
import { hasAd, renderNative } from 'shenshi-h5'
const showAd = () => {
renderNative({
adv_key: 'AD_KEY',
containerId: 'ad-container',
callback: (msg) => console.log(msg)
})
}
</script>
import { useEffect } from 'react'
import { init, hasAd, renderNative } from 'shenshi-h5'
function App() {
useEffect(() => {
init({
nativeAdvKeys: ['AD_KEY'],
interstitialAdvKeys: []
})
}, [])
const handleShowAd = () => {
if (hasAd('AD_KEY')) {
renderNative({
adv_key: 'AD_KEY',
containerId: 'ad-container',
callback: (msg) => console.log(msg)
})
}
}
return (
<div>
{hasAd('AD_KEY') && (
<button onClick={handleShowAd}>显示广告</button>
)}
<div id="ad-container"></div>
</div>
)
}
try {
await init({
nativeAdvKeys: ['KEY1', 'KEY2'],
interstitialAdvKeys: ['KEY3']
})
} catch (error) {
console.error('广告初始化失败:', error)
}
if (hasAd('AD_KEY')) {
renderNative({
adv_key: 'AD_KEY',
containerId: 'ad-container',
callback: (result) => {
if (result.includes('成功')) {
console.log('广告渲染成功')
} else {
console.log('广告渲染失败:', result)
}
}
})
}
// 检查所有原生广告
console.log('原生广告数据:', window.NativeData)
// 检查所有插屏广告
console.log('插屏广告数据:', window.InterstitialData)
// 检查特定广告
const isAvailable = hasAd('AD_KEY')
console.log('广告状态:', {
native: window.NativeData,
interstitial: window.InterstitialData
})
A: 请检查以下几点:
A: 使用真实的广告 key 进行测试,确保网络连接正常,并检查浏览器控制台输出。
A: 目前支持原生广告(Native)和插屏广告(Interstitial)。
FAQs
神蓍H5广告SDK - 专为移动端H5应用设计的广告展示解决方案
The npm package shenshi-h5 receives a total of 0 weekly downloads. As such, shenshi-h5 popularity was classified as not popular.
We found that shenshi-h5 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.

Security News
PHP releases emergency patches for two critical RCE vulnerabilities as agencies urge organizations to take unpatched sites offline.

Threat Research
/Security News
A supply chain attack compromised LiteLLM 1.107.0 on PyPI and Docker, spreading malware that steals cloud credentials, developer secrets, and AI provider keys.