Frontend Development 10 min read

Standardizing Interactive Tasks and Lottery Features on the Xianyu Platform

Xianyu standardized its interactive tasks and lottery features by abstracting capabilities into a reusable SDK, providing self‑diagnosis tools, and unifying configuration workflows, which cut front‑end development time by about half, enable operators to troubleshoot without developers, and lower launch and testing costs across large‑scale marketing events.

Xianyu Technology
Xianyu Technology
Xianyu Technology
Standardizing Interactive Tasks and Lottery Features on the Xianyu Platform

Background

Interactive game mechanics are widely used in apps to attract users, increase activity, and drive growth. Xianyu has expanded its platform benefits, leading to more task‑plus‑lottery interactions in daily and large‑scale marketing activities.

Pain Points

Insufficient abstraction of underlying capabilities causes repeated development and high cost.

Complex data flows across task, lottery, and points systems make troubleshooting difficult.

Configuration errors are often discovered late, requiring developer intervention and slowing releases.

Technical Solution

Abstract interactive capabilities into a reusable SDK for developers.

Provide self‑diagnosis tools in the configuration platform to let operators troubleshoot before testing.

Unify the interactive configuration platform to link lottery, task, and points settings, enforcing a standard workflow.

Interactive Task Standardization

Tasks are built on the Taobao task center and fall into three types: simple redirect, redirect with immediate reporting, and browse‑task with both front‑end and back‑end reporting. Reporting can be done via front‑end calls or event‑collection services.

Interactive Lottery Standardization

The front‑end abstracts lottery logic into an SDK, handling activity initialization, login checks, auto‑refresh, result display, and error handling.

SDK API

import Oliver from "@ali/pcom-fin-oliversdk";

const oliverSdk = new Oliver({
  activityId: '544',
  options: {
    oliverParams: {
      needBenefits: false,
      needDetails: false,
      needHadWin: false,
      extend: {}
    },
    autoUpdate: true,
    checkLogin: true
  },
  dataWatcher: (data) => {}
});

oliverSdk.draw({
  // optional extend params
}).then(res => { /* handle result */ });

oliverSdk.getLogs({ pageSize: 10, curPage: 1 }).then(res => { /* handle logs */ });

oliverSdk.update();

Hooks

To lower the SDK usage cost, a Rax‑based hook is provided.

import useOliver from '@ali/pcom-fin-oliver-raxhook';

const { oliverData, drawResultData, draw } = useOliver({ activityId: '544' });

useEffect(() => {
  const availableTimes = oliverData?.availableTimes || 0;
  // handle available times
}, [oliverData]);

useEffect(() => {
  // handle draw result
}, [drawResultData]);

draw();

Self‑Diagnosis

The SDK logs user actions and server responses locally and offers a log viewer that parses error codes, shows causes, and suggests fixes, enabling operators to troubleshoot without developer help.

Interactive Configuration Standardization

Select a delivery plan and view its benefit configuration.

Confirm benefits and set restriction rules.

Choose a fallback plan if needed.

Advanced settings for safety codes and point deductions.

Effects

Standardized interactive features have been deployed in multiple Xianyu scenarios (e.g., Double‑11, Five‑Fortune events).

Front‑end development time reduced by ~50%.

Operators can self‑diagnose issues, eliminating developer intervention.

Standard workflow catches configuration errors early, lowering testing cost.

Conclusion

By abstracting and standardizing interactive tasks and lotteries, Xianyu reduces launch cost, improves development efficiency, and enables low‑cost, high‑quality activity delivery.

frontendSDKInteractiveHookslotterytask standardization
Xianyu Technology
Written by

Xianyu Technology

Official account of the Xianyu technology team

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.