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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sency/react-native-smkit-ui

v0.2.3

Published

react-native-smkit-ui

Downloads

229

Readme

react-native-smkit-ui demo

  1. Installation
  2. Setup
  3. Configure
  4. Start
  5. Data

1. Installation

  1. run npm install @sency/react-native-smkit-ui

  2. Update Podfile in iOS folder:

[1] add the source to the top of your Podfile.
source 'https://bitbucket.org/sency-ios/sency_ios_sdk.git'
source 'https://github.com/CocoaPods/Specs.git'

[2] add use_frameworks! commend to your target
target 'YOUR_TARGET' do
  use_frameworks!
  1. Run NO_FLIPPER=1 pod install to install the necessary pods.

2. Setup

iOS

Add camera permission request to Info.plist

<key>NSCameraUsageDescription</key>
<string>Camera access is needed</string>

Android

In order to integrate SMKitUI you need to import the smkitui dependency Add on project level build.gradle:

allprojects {
   maven {
       url "https://artifacts.sency.ai/artifactory/release/"
   }
}

FBJNI

Both React Native and SencyMotion use fbjni. For example, the versions for SMKitUI that are used for development are:

React Native (<= 0.64) uses fbjni 0.0.2 SMKitUI uses fbjni 0.2.2. Therefore we need to exclude fbjbi on app level build.gradle:

dependencies {
 ...
 implementation('com.sency.smkitui:smkitui:$latest_version'){
   exclude group: 'com.facebook.fbjni', module: 'fbjni-java-only'
 }
 ...
}

3. Configure

[1] First import configure
import { configure } from '@sency/react-native-smkit-ui-dev/src/index.tsx';

[2] then call the configure function with your auth key
try{
  var res = await configure("YOUR_AUTH_KEY");
 }catch (e) {
  console.error(e);
}

To reduce wait time we recommend to call configure on app launch.

⚠️ smkit_ui_library will not work if you don't first call configure.

4. Start

  1. Import the sdk
import { startAssessment, startCustomWorkout, AssessmentTypes } from '@sency/react-native-smkit-ui-dev/src/index.tsx';
import SMKitUI from '@sency/react-native-smkit-ui-dev/src/SMKitUIView.tsx';
import * as SMWorkoutLibrary from '@sency/react-native-smkit-ui-dev/src/SMWorkout.tsx';
  1. Add SMKitUI view:
return (
  <View style={styles.centeredView}>
    <SMKitUI/>
  </View>
);

Start Assessment

startAssessment starts one of Sency's blueprint assessments.

async function startFitnessAssessment(){
  try{
    var result = await startAssessment(AssessmentTypes.Fitness, true); // => type: SMWorkoutLibrary.AssessmentTypes, showSummary:boolean
    console.log(result.summary);
    console.log(result.didFinish);
  }catch(e) {
    console.error(e);
  }
}

Check out this info page if you want to learn more about Sency's AI Fitness Assessment

Start Custom Workout

startWorkout starts a custom workout.

async function startSMKitUICustomWorkout(){
  try{
    // list of exercies
    var exercises = [
      new SMWorkoutLibrary.SMExercise(
        name: "First Exercise", // => name:string | null
        35,                     // => totalSeconds: number | null
        5,                      // => introSeconds: number | null
        null,                   // => videoInstruction: string | null (url for a video)
        null,                   // => exerciseIntro: string | null (url for a sound)
        [SMWorkoutLibrary.UIElement.RepsCounter, SMWorkoutLibrary.UIElement.Timer], // => uiElements: UIElement[] | null
        "HighKnees", // => detector: string
        true, // => repBased: boolean | null
        null, // => exerciseClosure: string | null (url for a sound)
        13, // => targetReps: number | null
        20, // => targetTime: number | null
        0.3 // => scoreFactor: number | null
      ),
      new SMWorkoutLibrary.SMExercise(
        "Second Exercise", // => name:string | null
        25, // => totalSeconds: number | null
        5, // => introSeconds: number | null
        null, // => videoInstruction: string | null (url for a video)
        null, // => exerciseIntro: string | null (url for a sound)
        [SMWorkoutLibrary.UIElement.GaugeOfMotion, SMWorkoutLibrary.UIElement.Timer], // => uiElements: UIElement[] | null
        "SquatRegularOverheadStatic", // => detector: string
        false, // => repBased: boolean | null
        null, // => exerciseClosure: string | null (url for a sound)
        null, // => targetReps: number | null
        20, // => targetTime: number | null
        0.3 // => scoreFactor: number | null
      ),
    ];

    var workout = new SMWorkoutLibrary.SMWorkout(
      "50", // => id: string | null
      "demo workout",// => name: string | null
      null, // => workoutIntro: string | null (url for a sound)
      null, // => soundtrack: string | null (url for a sound)
      exercises, // => exercises: SMExercise[]
      null, // =>  getInFrame: string | null (url for a sound)
      null, // =>  bodycalFinished: string | null (url for a sound)
      null // =>  workoutClosure: string | null (url for a sound)
      );
    var result = await startCustomWorkout(workout);
    console.log(result.summary);
    console.log(result.didFinish);
  }catch(e){
    console.error(e);
  }
}

Start Program

startWorkoutProgram starts a workout program according to your WorkoutConfig.

  async function startSMKitUIProgram(){
    try{
      //WorkoutConfig
      var config = new SMWorkoutLibrary.WorkoutConfig(
        3, // => week: number
        SMWorkoutLibrary.BodyZone.FullBody, // => bodyZone: BodyZone
        SMWorkoutLibrary.WorkoutDifficulty.HighDifficulty, // => difficultyLevel: WorkoutDifficulty
        SMWorkoutLibrary.WorkoutDuration.Short, // =>   workoutDuration: WorkoutDuration
        "YOUR_PROGRAM_ID" // =>   programID: string
      );
      var result = await startWorkoutProgram(config);
      console.log(result.summary);
      console.log(result.didFinish);
    }catch(e){
      console.error(e);
    }
  }
}

Available Data Types

AssessmentTypes

| Name | |---------------------| | Fitness | | Custom |

Having issues? Contact us and let us know what the problem is.